From d0eca387eee2cd7fb41ac47a278d36e6e2aee4a4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 17 Jul 2019 10:25:43 +0200 Subject: [PATCH] js: Also handle spinner elements which are not direct descendants of an element --- public/js/icinga/events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 5678b66e4..363ef5045 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -348,8 +348,8 @@ } // Show a spinner depending on how the form is being submitted - if (autosubmit && typeof $el !== 'undefined' && $el.next().hasClass('spinner')) { - $el.next().addClass('active'); + if (autosubmit && typeof $el !== 'undefined' && $el.siblings('.spinner').length) { + $el.siblings('.spinner').first().addClass('active'); } else if ($button.length && $button.is('button') && $button.hasClass('animated')) { $button.addClass('active'); } else if ($button.length && $button.attr('data-progress-label')) {