Skip to content

Commit

Permalink
convert to native .prepend
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Mar 16, 2024
1 parent 8f94678 commit 8d434a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web_src/js/features/repo-issue-list.js
@@ -1,6 +1,6 @@
import $ from 'jquery';
import {updateIssuesMeta} from './repo-issue.js';
import {toggleElem, hideElem} from '../utils/dom.js';
import {toggleElem, hideElem, isElemHidden} from '../utils/dom.js';
import {htmlEscape} from 'escape-goat';
import {confirmModal} from './comp/ConfirmModal.js';
import {showErrorToast} from '../modules/toast.js';
Expand Down Expand Up @@ -30,7 +30,10 @@ function initRepoIssueListCheckboxes() {
toggleElem($('#issue-filters'), !anyChecked);
toggleElem($('#issue-actions'), anyChecked);
// there are two panels but only one select-all checkbox, so move the checkbox to the visible panel
$('#issue-filters, #issue-actions').filter(':visible').find('.issue-list-toolbar-left').prepend(issueSelectAll);
const panels = document.querySelectorAll('#issue-filters, #issue-actions');
const visiblePanel = Array.from(panels).find((el) => !isElemHidden(el));
const toolbarLeft = visiblePanel.querySelector('.issue-list-toolbar-left');
toolbarLeft.prepend(issueSelectAll);
};

for (const el of issueCheckboxes) {
Expand Down

0 comments on commit 8d434a2

Please sign in to comment.