js: Use window.FormData instead of just FormData

refs #8758
This commit is contained in:
Johannes Meyer 2015-07-15 15:49:34 +02:00
parent c1d9cde312
commit 6d4d99aa62
2 changed files with 3 additions and 3 deletions

View File

@ -272,14 +272,14 @@
url = icinga.utils.addUrlParams(url, dataObj);
} else {
if (encoding === 'multipart/form-data') {
data = new FormData($form[0]);
data = new window.FormData($form[0]);
} else {
data = $form.serializeArray();
}
if (typeof autosubmit === 'undefined' || ! autosubmit) {
if ($button.length && $button.attr('name') !== 'undefined') {
if (data instanceof FormData) {
if (encoding === 'multipart/form-data') {
data.append($button.attr('name'), $button.attr('value'));
} else {
data.push({

View File

@ -103,7 +103,7 @@
// This is jQuery's default content type
var contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
var isFormData = data instanceof FormData;
var isFormData = data instanceof window.FormData;
if (isFormData) {
// Setting false is mandatory as the form's data
// won't be recognized by the server otherwise