Submit forms to the container's target URL if the form's action is not set

refs #8605
This commit is contained in:
Eric Lippmann 2015-03-13 04:02:42 +01:00
parent f60a0b86ec
commit 1bd2e7cb84
1 changed files with 9 additions and 3 deletions

View File

@ -239,10 +239,8 @@
event.stopPropagation();
event.preventDefault();
icinga.logger.debug('Submitting form: ' + method + ' ' + url, method);
if ($button.length) {
// activate spinner indicator
// Activate spinner
if ($button.hasClass('spinner')) {
$button.addClass('active');
}
@ -252,6 +250,13 @@
$target = self.getLinkTargetFor($form);
}
if (! url) {
// Use the URL of the target container if the form's action is not set
url = $target.closest('.container').data('icinga-url');
}
icinga.logger.debug('Submitting form: ' + method + ' ' + url, method);
if (method === 'GET') {
var dataObj = $form.serializeObject();
@ -274,6 +279,7 @@
}
}
}
icinga.loader.loadUrl(url, $target, data, method);
return false;