Skip to content

Commit e871ae7

Browse files
committed
MAGETWO-95392 : Widget changes
1 parent 2d9c1e6 commit e871ae7

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Widget extends \Magento\Backend\Block\Widget\Form\Container
1717
{
1818
/**
19-
* @return void
19+
* @inheritdoc
2020
*/
2121
protected function _construct()
2222
{
@@ -36,12 +36,16 @@ protected function _construct()
3636
$this->buttonList->update('save', 'region', 'footer');
3737
$this->buttonList->update('save', 'data_attribute', []);
3838

39-
$this->_formScripts[] = 'require(["mage/adminhtml/wysiwyg/widget"], function(){wWidget = new WysiwygWidget.Widget(' .
40-
'"widget_options_form", "select_widget_type", "widget_options", "' .
41-
$this->getUrl(
42-
'adminhtml/*/loadOptions'
43-
) . '", "' . $this->getRequest()->getParam(
44-
'widget_target_id'
45-
) . '");});';
39+
$this->_formScripts[] = <<<EOJS
40+
require(['mage/adminhtml/wysiwyg/widget'], function() {
41+
wWidget = new WysiwygWidget.Widget(
42+
'widget_options_form',
43+
'select_widget_type',
44+
'widget_options',
45+
'{$this->getUrl('adminhtml/*/loadOptions')}',
46+
'{$this->_escaper->escapeJs((string)$this->getRequest()->getParam('widget_target_id'))}'
47+
);
48+
});
49+
EOJS;
4650
}
4751
}

0 commit comments

Comments
 (0)