Unverified Commit 650a8aee authored by lauriii's avatar lauriii

Issue #2215857 followup by gaydamaka, timmillwood, alexpott, lauriii:...

Issue #2215857 followup by gaydamaka, timmillwood, alexpott, lauriii: Regression on Internet Explorer 11

(cherry picked from commit 266f3f9c1517e1b6b34891474a15f12dd3caa329)
parent 5b52c418
......@@ -774,7 +774,7 @@
// when there is a form such that this.$form.ajaxSubmit() is used instead of
// $.ajax(). When there is no form and $.ajax() is used, beforeSerialize()
// isn't called, but don't rely on that: explicitly check this.$form.
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
const settings = this.settings || drupalSettings;
Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
}
......@@ -1020,7 +1020,7 @@
// attachBehaviors() called on the new content from processing the response
// commands is not sufficient, because behaviors from the entire form need
// to be reattached.
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
const settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
......@@ -1090,7 +1090,7 @@
$(this.element).prop('disabled', false);
// Reattach behaviors, if they were detached in beforeSerialize(), and the
// form is still part of the document.
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
const settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
......
......@@ -339,7 +339,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
};
Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
}
......@@ -451,7 +451,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
}
}
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
......@@ -493,7 +493,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
$(this.element).prop('disabled', false);
if (this.$form && document.contains(this.$form.get(0))) {
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment