Fix that a form's submit button is not being sent when the method is GET

fixes #6890
This commit is contained in:
Johannes Meyer 2014-08-12 12:49:03 +02:00
parent 143db976ef
commit 7958a81975
1 changed files with 10 additions and 2 deletions

View File

@ -355,12 +355,20 @@
$target = self.getLinkTargetFor($form);
if (method === 'GET') {
url = icinga.utils.addUrlParams(url, $form.serializeObject());
var dataObj = $form.serializeObject();
if (typeof autosubmit === 'undefined' || ! autosubmit) {
if ($button.length && $button.attr('name') !== 'undefined') {
dataObj[$button.attr('name')] = $button.attr('value');
}
}
url = icinga.utils.addUrlParams(url, dataObj);
} else {
data = $form.serializeArray();
if (typeof autosubmit === 'undefined' || ! autosubmit) {
if ($button.length) {
if ($button.length && $button.attr('name') !== 'undefined') {
data.push({
name: $button.attr('name'),
value: $button.attr('value')