From 5270acd645209e021b966f50824fdb91274f03f9 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 12 Mar 2015 11:30:21 +0100 Subject: [PATCH] events.js: correctly detect form target container This is for forms with no submit button. fixes #8710 --- public/js/icinga/events.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index c7674a63d..d29f39aa2 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -239,14 +239,18 @@ event.stopPropagation(); event.preventDefault(); - // activate spinner indicator - if ($button.hasClass('spinner')) { - $button.addClass('active'); - } - icinga.logger.debug('Submitting form: ' + method + ' ' + url, method); - $target = self.getLinkTargetFor($button); + if ($button.length) { + // activate spinner indicator + if ($button.hasClass('spinner')) { + $button.addClass('active'); + } + + $target = self.getLinkTargetFor($button); + } else { + $target = self.getLinkTargetFor($form); + } if (method === 'GET') { var dataObj = $form.serializeObject();