@@ -286,15 +286,19 @@ protected function _getPluginButtonsHtml($visible = true)
286
286
287
287
// Button to media images insertion window
288
288
if ($ this ->getConfig ('add_images ' )) {
289
+ $ htmlId = $ this ->getHtmlId ();
290
+ $ url = $ this ->getConfig ('files_browser_window_url ' )
291
+ . 'target_element_id/ '
292
+ . $ htmlId
293
+ . '/ '
294
+ . (null !== $ this ->getConfig ('store_id ' )
295
+ ? 'store/ ' . $ this ->getConfig ('store_id ' ) . '/" '
296
+ : '' );
289
297
$ buttonsHtml .= $ this ->_getButtonHtml (
290
298
[
291
299
'title ' => $ this ->translate ('Insert Image... ' ),
292
- 'onclick ' => "MediabrowserUtility.openDialog(' "
293
- . $ this ->getConfig ('files_browser_window_url ' )
294
- . "target_element_id/ " . $ this ->getHtmlId () . "/ "
295
- . (null !== $ this ->getConfig ('store_id ' ) ? 'store/ '
296
- . $ this ->getConfig ('store_id ' ) . '/ ' : '' )
297
- . "') " ,
300
+ 'onclick ' => 'MediabrowserUtility.openDialog( \'' . $ url
301
+ . '\', null, null, null, { \'targetElementId \': \'' . $ htmlId . '\' }) ' ,
298
302
'class ' => 'action-add-image plugin ' ,
299
303
'style ' => $ visible ? '' : 'display:none ' ,
300
304
]
@@ -496,13 +500,13 @@ protected function getInlineJs($jsSetupObject, $forceLoad)
496
500
$ jsString = '
497
501
<script type="text/javascript">
498
502
//<![CDATA[
499
- window.tinyMCE_GZ = window.tinyMCE_GZ || {};
503
+ window.tinyMCE_GZ = window.tinyMCE_GZ || {};
500
504
window.tinyMCE_GZ.loaded = true;
501
505
require([
502
- "jquery",
503
- "mage/translate",
504
- "mage/adminhtml/events",
505
- "mage/adminhtml/wysiwyg/tiny_mce/setup",
506
+ "jquery",
507
+ "mage/translate",
508
+ "mage/adminhtml/events",
509
+ "mage/adminhtml/wysiwyg/tiny_mce/setup",
506
510
"mage/adminhtml/wysiwyg/widget"
507
511
], function(jQuery){ ' .
508
512
"\n" .
0 commit comments