File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed
app/code/Magento/PageBuilder/view/adminhtml Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 23
23
</dataProvider >
24
24
</dataSource >
25
25
<modal name =" modal" component =" Magento_PageBuilder/js/modal/modal" >
26
+ <argument name =" data" xsi : type =" array" >
27
+ <item name =" config" xsi : type =" array" >
28
+ <item name =" insertFormProvider" xsi : type =" string" >${ $.name }.insert_form</item >
29
+ </item >
30
+ </argument >
26
31
<settings >
27
32
<options >
28
33
<option name =" title" xsi : type =" string" translate =" true" >Edit</option >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ define([
25
25
listens : {
26
26
conditionOption : 'updateProductTotals' ,
27
27
conditionValue : 'updateProductTotals' ,
28
+ '${ $.provider }:data.modalClosed' : 'abortRunningRequest'
28
29
} ,
29
30
imports : {
30
31
formData : '${ $.provider }:data'
@@ -42,15 +43,6 @@ define([
42
43
jqXHR : null
43
44
} ,
44
45
45
- /** @inheritdoc */
46
- initialize : function ( ) {
47
- $ ( '.cms-page-edit .modals-wrapper' ) . on ( 'modalclosed' , function ( ) {
48
- this . abortRunningRequest ( ) ;
49
- } . bind ( this ) ) ;
50
-
51
- return this . _super ( ) ;
52
- } ,
53
-
54
46
/**
55
47
* Abort running Ajax request
56
48
*/
Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ define([
11
11
12
12
return ModalComponent . extend ( {
13
13
defaults : {
14
- titlePrefix : '${ $.options.title }'
14
+ titlePrefix : '${ $.options.title }' ,
15
+ modules : {
16
+ insertForm : '${ $.insertFormProvider }'
17
+ }
15
18
} ,
16
19
17
20
/** @inheritdoc */
@@ -37,6 +40,19 @@ define([
37
40
this . closeModal ( ) ;
38
41
} . bind ( this ) ) ;
39
42
43
+ } ,
44
+
45
+ /**
46
+ * Trigger modalClosed event on external provider
47
+ *
48
+ * @returns {any }
49
+ */
50
+ closeModal : function ( ) {
51
+ this . insertForm ( ) &&
52
+ this . insertForm ( ) . externalSource ( ) &&
53
+ this . insertForm ( ) . externalSource ( ) . trigger ( 'data.modalClosed' ) ;
54
+
55
+ return this . _super ( ) ;
40
56
}
41
57
} ) ;
42
58
} ) ;
You can’t perform that action at this time.
0 commit comments