Skip to content

Commit

Permalink
Allow commit status popup on /pulls page
Browse files Browse the repository at this point in the history
The /pulls page doesn't contain a "repository" element, so the early-out here was preventing the commit status popup hook from working. However, the only thing the .repository element is being used for here is determining whether the popup should be on the right or on the left, so we don't actually need the element to exist for the hook to work.

Pull request go-gitea#19375 allows the statuses on /pulls pages to appear clickable, but this commit is required to make the popup actually work there.
  • Loading branch information
parnic committed Apr 26, 2022
1 parent 03eba32 commit b1f1c98
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions web_src/js/features/repo-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,6 @@ async function onEditContent(event) {
}

export function initRepository() {
if ($('.repository').length === 0) {
return;
}


// Commit statuses
$('.commit-statuses-trigger').each(function () {
const positionRight = $('.repository.file.list').length > 0 || $('.repository.diff').length > 0;
Expand All @@ -434,6 +429,10 @@ export function initRepository() {
position: popupPosition,
});
});

if ($('.repository').length === 0) {
return;
}

// File list and commits
if ($('.repository.file.list').length > 0 || $('.branch-dropdown').length > 0 ||
Expand Down

0 comments on commit b1f1c98

Please sign in to comment.