@@ -53,20 +53,14 @@ define([
53
53
content = '<div class="popup-window" id="' + windowId + '"></div>' ,
54
54
self = this ;
55
55
56
- if ( options &&
57
- self . targetElementId &&
58
- self . targetElementId === options . targetElementId ) {
56
+ if ( this . modalLoaded ) {
57
+
59
58
if ( typeof options . closed !== 'undefined' ) {
60
59
this . modal . modal ( 'option' , 'closed' , options . closed ) ;
61
60
}
62
- this . modal . modal ( 'openModal' ) ;
63
61
64
- return ;
65
- } else if ( _ . isUndefined ( options ) &&
66
- self . modalLoaded === true &&
67
- self . targetElementId === url
68
- ) {
69
62
this . modal . modal ( 'openModal' ) ;
63
+ $ ( window ) . trigger ( 'reload.MediaGallery' ) ;
70
64
71
65
return ;
72
66
}
@@ -95,9 +89,6 @@ define([
95
89
} ) . done ( function ( data ) {
96
90
self . modal . html ( data ) . trigger ( 'contentUpdated' ) ;
97
91
self . modalLoaded = true ;
98
- self . targetElementId = options ?
99
- options . targetElementId
100
- : url ;
101
92
} ) ;
102
93
103
94
} ,
@@ -140,7 +131,8 @@ define([
140
131
'click #delete_files' : 'deleteFiles' ,
141
132
'click #insert_files' : 'insertSelectedFiles' ,
142
133
'fileuploaddone' : '_uploadDone' ,
143
- 'click [data-row=breadcrumb]' : 'selectFolder'
134
+ 'click [data-row=breadcrumb]' : 'selectFolder' ,
135
+ 'reload.MediaGallery' : 'reload'
144
136
} ) ;
145
137
this . activeNode = null ;
146
138
//tree dont use event bubbling
0 commit comments