Skip to content

Commit dbea8db

Browse files
committed
Merge remote-tracking branch 'obsessive-owls/MAGETWO-95391' into 2.3.0-qwerty-bugs1
2 parents 8016ebc + 93a2d71 commit dbea8db

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

app/code/Magento/Widget/Block/Adminhtml/Widget.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
class Widget extends \Magento\Backend\Block\Widget\Form\Container
1616
{
1717
/**
18-
* @return void
18+
* @inheritdoc
19+
*
20+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
1921
*/
2022
protected function _construct()
2123
{
@@ -40,13 +42,16 @@ protected function _construct()
4042
$this->buttonList->update('reset', 'label', __('Cancel'));
4143
$this->buttonList->update('reset', 'onclick', 'wWidget.closeModal()');
4244

43-
$this->_formScripts[] = 'require(["mage/adminhtml/wysiwyg/widget"],'
44-
. ' function(){wWidget = new WysiwygWidget.Widget('
45-
. '"widget_options_form", "select_widget_type", "widget_options", "'
46-
. $this->getUrl(
47-
'adminhtml/*/loadOptions'
48-
) . '", "' . $this->getRequest()->getParam(
49-
'widget_target_id'
50-
) . '");});';
45+
$this->_formScripts[] = <<<EOJS
46+
require(['mage/adminhtml/wysiwyg/widget'], function() {
47+
wWidget = new WysiwygWidget.Widget(
48+
'widget_options_form',
49+
'select_widget_type',
50+
'widget_options',
51+
'{$this->getUrl('adminhtml/*/loadOptions')}',
52+
'{$this->escapeJs($this->getRequest()->getParam('widget_target_id'))}'
53+
);
54+
});
55+
EOJS;
5156
}
5257
}

0 commit comments

Comments
 (0)