@@ -11,11 +11,12 @@ define([
11
11
'Magento_Ui/js/modal/prompt' ,
12
12
'Magento_Ui/js/modal/confirm' ,
13
13
'Magento_Ui/js/modal/alert' ,
14
+ 'underscore' ,
14
15
'Magento_Ui/js/modal/modal' ,
15
16
'jquery/ui' ,
16
17
'jquery/jstree/jquery.jstree' ,
17
- 'mage/mage'
18
- ] , function ( $ , wysiwyg , prompt , confirm , alert ) {
18
+ 'mage/mage' ,
19
+ ] , function ( $ , wysiwyg , prompt , confirm , alert , _ ) {
19
20
window . MediabrowserUtility = {
20
21
windowId : 'modal_dialog_message' ,
21
22
modalLoaded : false ,
@@ -63,13 +64,15 @@ define([
63
64
64
65
return ;
65
66
} else if ( _ . isUndefined ( options ) && self . modalLoaded === true ) {
66
- this . modal . modal ( 'openModal' ) ;
67
- return ;
67
+ if ( self . targetElementId === url ) {
68
+ this . modal . modal ( 'openModal' ) ;
69
+ return ;
70
+ }
68
71
}
69
72
70
73
if ( this . modal ) {
71
74
this . modal . html ( $ ( content ) . html ( ) ) ;
72
-
75
+
73
76
if ( options && typeof options . closed !== 'undefined' ) {
74
77
this . modal . modal ( 'option' , 'closed' , options . closed ) ;
75
78
}
@@ -93,7 +96,7 @@ define([
93
96
self . modalLoaded = true ;
94
97
self . targetElementId = options
95
98
? options . targetElementId
96
- : 'null' ;
99
+ : url ;
97
100
} ) ;
98
101
} ,
99
102
0 commit comments