Skip to content

Commit

Permalink
fix rowselectioncontroller for multiple tables
Browse files Browse the repository at this point in the history
when there are 2 or more tables with a rowselectioncontroller, then it
is not possible to update the icon of the first table by calling
`window.updateTableHeaderCheckbox`
Replace by reacting on an event sent to the dropdown
  • Loading branch information
mawinter69 committed Feb 1, 2025
1 parent 85be6b6 commit c105dd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/src/main/resources/hudson/PluginManager/_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ window.addEventListener("load", function () {
candidate.checked = candidate.dataset.compatWarning === "false";
}
}
window.updateTableHeaderCheckbox();
const ev = new CustomEvent("updateIcon", {
bubbles: true,
});
compatibleCheckbox.dispatchEvent(ev);
});
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/js/components/row-selection-controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ rowSelectionControllers.forEach((headerCheckbox) => {
"jenkins-table__checkbox-dropdown--visible",
);
});
moreOptionsDropdown.addEventListener("updateIcon", (e) => {
updateIcon();
e.stopPropagation();
});
}

window.updateTableHeaderCheckbox = updateIcon;
});

0 comments on commit c105dd7

Please sign in to comment.