Skip to content

Commit f229056

Browse files
committed
Fix issue with WYSIWYG editors magento/adobe-stock-integration/issues/622
1 parent 3efbe15 commit f229056

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/web/mage/adminhtml/browser.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ 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-
options &&
57-
self.targetElementId &&
58-
self.targetElementId === options.targetElementId
59-
) {
60-
if (typeof options.closed !== 'undefined') {
54+
55+
if (this.modalLoaded === true
56+
|| (self.targetElementId
57+
&& self.targetElementId === options.targetElementId)) {
58+
59+
if (options && typeof options.closed !== 'undefined') {
6160
this.modal.modal('option', 'closed', options.closed);
6261
}
6362
this.modal.modal('openModal');
@@ -89,9 +88,9 @@ define([
8988
}).done(function (data) {
9089
self.modal.html(data).trigger('contentUpdated');
9190
self.modalLoaded = true;
92-
self.targetElementId = options.targetElementId;
91+
options ? self.targetElementId = options.targetElementId : '';
9392
});
94-
},
93+
},
9594

9695
/**
9796
* Close dialog.

0 commit comments

Comments
 (0)