added fix for doubled parameters

This commit is contained in:
Frank Stelzer 2014-05-22 16:49:01 +00:00
parent 94243f0a3e
commit 54e5fae3de

View File

@ -269,6 +269,7 @@
self = this, self = this,
params = {}, params = {},
formData = new FormData(), formData = new FormData(),
doubledParams = {},
headers = {}, headers = {},
content = $(this).find('textarea.content').val(), content = $(this).find('textarea.content').val(),
result_container = $('.result', $(this).parent()); result_container = $('.result', $(this).parent());
@ -338,7 +339,12 @@
value = $('.value', $(this)).val(); value = $('.value', $(this)).val();
if (value) { if (value) {
params[key] = value; // temporary save all additional/doubled parameters
if (key in params) {
doubledParams[key] = value;
} else {
params[key] = value;
}
} }
}); });
@ -367,7 +373,12 @@
} }
}; };
// disable all the fields and buttons // merge additional params back to real params object
if (!$.isEmptyObject(doubledParams)) {
$.extend(params, doubledParams);
}
// disable all the fiels and buttons
$('input, button', $(this)).attr('disabled', 'disabled'); $('input, button', $(this)).attr('disabled', 'disabled');
// append the query authentication // append the query authentication