1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-05 01:57:20 +00:00

Make commit-statuses popup show correctly (#17447) (#17466)

Backport #17447

Close #17443
This commit is contained in:
wxiaoguang
2021-10-28 15:42:31 +08:00
committed by GitHub
parent 2c383d812d
commit 548ae3eb98
2 changed files with 19 additions and 3 deletions

View File

@ -788,10 +788,13 @@ async function initRepository() {
// Commit statuses
$('.commit-statuses-trigger').each(function () {
const positionRight = $('.repository.file.list').length > 0 || $('.repository.diff').length > 0;
const popupPosition = positionRight ? 'right center' : 'left center';
$(this)
.popup({
on: 'click',
position: ($('.repository.file.list').length > 0 ? 'right center' : 'left center'),
lastResort: popupPosition, // prevent error message "Popup does not fit within the boundaries of the viewport"
position: popupPosition,
});
});