Skip to content

Commit a07627c

Browse files
committed
WYSIWYG Image-Popup is not working correctly with multipleEditors
1 parent f229056 commit a07627c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

lib/web/mage/adminhtml/browser.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,26 @@ define([
5151
var windowId = this.windowId,
5252
content = '<div class="popup-window" id="' + windowId + '"></div>',
5353
self = this;
54-
55-
if (this.modalLoaded === true
56-
|| (self.targetElementId
57-
&& self.targetElementId === options.targetElementId)) {
58-
59-
if (options && typeof options.closed !== 'undefined') {
54+
55+
if (options
56+
&& self.targetElementId
57+
&& self.targetElementId === options.targetElementId
58+
) {
59+
if (typeof options.closed !== 'undefined') {
6060
this.modal.modal('option', 'closed', options.closed);
6161
}
6262
this.modal.modal('openModal');
6363

6464
return;
65+
} else if (typeof options === 'undefined'
66+
&& self.modalLoaded === true) {
67+
this.modal.modal('openModal');
68+
return;
6569
}
6670

6771
if (this.modal) {
6872
this.modal.html($(content).html());
69-
73+
7074
if (options && typeof options.closed !== 'undefined') {
7175
this.modal.modal('option', 'closed', options.closed);
7276
}
@@ -88,9 +92,11 @@ define([
8892
}).done(function (data) {
8993
self.modal.html(data).trigger('contentUpdated');
9094
self.modalLoaded = true;
91-
options ? self.targetElementId = options.targetElementId : '';
95+
self.targetElementId = options
96+
? options.targetElementId
97+
: 'null';
9298
});
93-
},
99+
},
94100

95101
/**
96102
* Close dialog.

lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ define([
375375
*/
376376
openFileBrowser: function (o) {
377377
var typeTitle = this.translate('Select Images'),
378-
storeId = this.config['store_id'] !== null ? this.config['store_id'] : 0,
378+
storeId = this.config['store_id'] ? this.config['store_id'] : 0,
379379
frameDialog = jQuery('div.mce-container[role="dialog"]'),
380380
self = this,
381381
wUrl = this.config['files_browser_window_url'] +

0 commit comments

Comments
 (0)