Skip to content

Commit

Permalink
js: Only add .impact to a container's content
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Aug 7, 2024
1 parent 62cae50 commit 97f8767
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions public/js/icinga/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@
req.progressTimer = progressTimer;

if ($autoSubmittedBy) {
if ($autoSubmittedBy.closest('.controls').length) {
$('.content', req.$target).addClass('impact');
const $closestControls = $autoSubmittedBy.closest('.controls');
if ($closestControls.length && $closestControls[0].parentNode === req.$target[0]) {
$(':scope > .content', req.$target).addClass('impact');
} else {
req.$target.addClass('impact');
}
Expand Down Expand Up @@ -965,7 +966,7 @@
if (req.$target.hasClass('impact')) {
req.$target.removeClass('impact');
} else {
var $impact = req.$target.find('.impact').first();
const $impact = req.$target.find(':scope > .content.impact').first();
if ($impact.length) {
$impact.removeClass('impact');
}
Expand Down

0 comments on commit 97f8767

Please sign in to comment.