events.js: correctly detect form target container

This is for forms with no submit button.

fixes #8710
This commit is contained in:
Thomas Gelf 2015-03-12 11:30:21 +01:00
parent 3af36015ff
commit 5270acd645
1 changed files with 10 additions and 6 deletions

View File

@ -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();