diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
index ed105bd2c18f5..604988588aac5 100755
--- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
+++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
@@ -238,12 +238,16 @@ define([
* @param {Object} o
*/
openFileBrowser: function (o) {
+ var targetElementID = tinymce.activeEditor.getElement().getAttribute('id');
+ var originId = this.id;
+ this.initialize(targetElementID, this.config);
+
var typeTitle,
storeId = this.config['store_id'] !== null ? this.config['store_id'] : 0,
frameDialog = jQuery(o.win.frameElement).parents('[role="dialog"]'),
wUrl = this.config['files_browser_window_url'] +
- 'target_element_id/' + this.id + '/' +
- 'store/' + storeId + '/';
+ 'target_element_id/' + this.id + '/' +
+ 'store/' + storeId + '/';
this.mediaBrowserOpener = o.win;
this.mediaBrowserTargetElementId = o.field;
@@ -255,6 +259,8 @@ define([
typeTitle = this.translate('Insert File...');
}
+ this.initialize(originId, this.config);
+
frameDialog.hide();
jQuery('#mceModalBlocker').hide();