@@ -11,11 +11,12 @@ define([
1111 'Magento_Ui/js/modal/prompt' ,
1212 'Magento_Ui/js/modal/confirm' ,
1313 'Magento_Ui/js/modal/alert' ,
14+ 'underscore' ,
1415 'Magento_Ui/js/modal/modal' ,
1516 'jquery/ui' ,
1617 'jquery/jstree/jquery.jstree' ,
1718 'mage/mage'
18- ] , function ( $ , wysiwyg , prompt , confirm , alert ) {
19+ ] , function ( $ , wysiwyg , prompt , confirm , alert , _ ) {
1920 window . MediabrowserUtility = {
2021 windowId : 'modal_dialog_message' ,
2122 modalLoaded : false ,
@@ -52,16 +53,21 @@ define([
5253 content = '<div class="popup-window" id="' + windowId + '"></div>' ,
5354 self = this ;
5455
55- if ( this . modalLoaded === true &&
56- options &&
56+ if ( options &&
5757 self . targetElementId &&
58- self . targetElementId === options . targetElementId
59- ) {
58+ self . targetElementId === options . targetElementId ) {
6059 if ( typeof options . closed !== 'undefined' ) {
6160 this . modal . modal ( 'option' , 'closed' , options . closed ) ;
6261 }
6362 this . modal . modal ( 'openModal' ) ;
6463
64+ return ;
65+ } else if ( _ . isUndefined ( options ) &&
66+ self . modalLoaded === true &&
67+ self . targetElementId === url
68+ ) {
69+ this . modal . modal ( 'openModal' ) ;
70+
6571 return ;
6672 }
6773
@@ -89,8 +95,11 @@ define([
8995 } ) . done ( function ( data ) {
9096 self . modal . html ( data ) . trigger ( 'contentUpdated' ) ;
9197 self . modalLoaded = true ;
92- self . targetElementId = options . targetElementId ;
98+ self . targetElementId = options ?
99+ options . targetElementId
100+ : url ;
93101 } ) ;
102+
94103 } ,
95104
96105 /**
@@ -487,7 +496,7 @@ define([
487496 var nodeData = $ ( element ) . data ( 'node' ) ;
488497
489498 if ( index > 0 ) {
490- breadcrumbs . append ( $ ( '<li>\/</li>' ) ) ;
499+ breadcrumbs . append ( $ ( '<li>\/</li>' ) ) ; //eslint-disable-line
491500 }
492501 breadcrumbs . append ( $ ( '<li />' )
493502 . data ( 'node' , nodeData ) . attr ( 'data-row' , 'breadcrumb' ) . text ( nodeData . text ) ) ;
0 commit comments