Skip to content

Commit

Permalink
ENGCOM-1960: Small refactoring to better code readability #16010
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov authored Jun 13, 2018
2 parents 6f2d929 + 7c6cf11 commit ce0af22
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ protected function _toHtml()
if (!$this->_depends) {
return '';
}
return '<script>
require(["mage/adminhtml/form"], function(){
new FormElementDependenceController(' .
$this->_getDependsJson() .
($this->_configOptions ? ', ' .
$this->_jsonEncoder->encode(
$this->_configOptions
) : '') . '); });</script>';

$params = $this->_getDependsJson();

if ($this->_configOptions) {
$params .= ', ' . $this->_jsonEncoder->encode($this->_configOptions);
}

return "<script>
require(['mage/adminhtml/form'], function(){
new FormElementDependenceController({$params});
});
</script>";
}

/**
Expand Down

0 comments on commit ce0af22

Please sign in to comment.