Skip to content

Commit c839ecc

Browse files
author
Stanislav Idolov
committed
magento/adobe-stock-integration#935 : Loader stays over the media gallery if it was opened second time from different control on the same page
1 parent d69c242 commit c839ecc

File tree

1 file changed

+15
-11
lines changed
  • lib/internal/Magento/Framework/Data/Form/Element

1 file changed

+15
-11
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Editor.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,19 @@ protected function _getPluginButtonsHtml($visible = true)
286286

287287
// Button to media images insertion window
288288
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+
: '');
289297
$buttonsHtml .= $this->_getButtonHtml(
290298
[
291299
'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 . '\' })',
298302
'class' => 'action-add-image plugin',
299303
'style' => $visible ? '' : 'display:none',
300304
]
@@ -496,13 +500,13 @@ protected function getInlineJs($jsSetupObject, $forceLoad)
496500
$jsString = '
497501
<script type="text/javascript">
498502
//<![CDATA[
499-
window.tinyMCE_GZ = window.tinyMCE_GZ || {};
503+
window.tinyMCE_GZ = window.tinyMCE_GZ || {};
500504
window.tinyMCE_GZ.loaded = true;
501505
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",
506510
"mage/adminhtml/wysiwyg/widget"
507511
], function(jQuery){' .
508512
"\n" .

0 commit comments

Comments
 (0)