File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 774774 // when there is a form such that this.$form.ajaxSubmit() is used instead of
775775 // $.ajax(). When there is no form and $.ajax() is used, beforeSerialize()
776776 // isn't called, but don't rely on that: explicitly check this.$form.
777- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
777+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
778778 const settings = this . settings || drupalSettings ;
779779 Drupal . detachBehaviors ( this . $form . get ( 0 ) , settings , 'serialize' ) ;
780780 }
10201020 // attachBehaviors() called on the new content from processing the response
10211021 // commands is not sufficient, because behaviors from the entire form need
10221022 // to be reattached.
1023- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
1023+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
10241024 const settings = this . settings || drupalSettings ;
10251025 Drupal . attachBehaviors ( this . $form . get ( 0 ) , settings ) ;
10261026 }
10901090 $ ( this . element ) . prop ( 'disabled' , false ) ;
10911091 // Reattach behaviors, if they were detached in beforeSerialize(), and the
10921092 // form is still part of the document.
1093- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
1093+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
10941094 const settings = this . settings || drupalSettings ;
10951095 Drupal . attachBehaviors ( this . $form . get ( 0 ) , settings ) ;
10961096 }
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
339339 } ;
340340
341341 Drupal . Ajax . prototype . beforeSerialize = function ( element , options ) {
342- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
342+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
343343 var settings = this . settings || drupalSettings ;
344344 Drupal . detachBehaviors ( this . $form . get ( 0 ) , settings , 'serialize' ) ;
345345 }
@@ -451,7 +451,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
451451 }
452452 }
453453
454- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
454+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
455455 var settings = this . settings || drupalSettings ;
456456 Drupal . attachBehaviors ( this . $form . get ( 0 ) , settings ) ;
457457 }
@@ -493,7 +493,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
493493
494494 $ ( this . element ) . prop ( 'disabled' , false ) ;
495495
496- if ( this . $form && document . contains ( this . $form . get ( 0 ) ) ) {
496+ if ( this . $form && document . body . contains ( this . $form . get ( 0 ) ) ) {
497497 var settings = this . settings || drupalSettings ;
498498 Drupal . attachBehaviors ( this . $form . get ( 0 ) , settings ) ;
499499 }
You can’t perform that action at this time.
0 commit comments