Skip to content

Commit

Permalink
Fix wrong position of button list when load "New Attribute" page
Browse files Browse the repository at this point in the history
  • Loading branch information
edenduong committed Apr 4, 2020
1 parent 58c2171 commit 59dd0db
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public function __construct(
}

/**
* Construct block
*
* @return void
*/
protected function _construct()
Expand All @@ -51,6 +53,14 @@ protected function _construct()

parent::_construct();

$this->buttonList->update('save', 'label', __('Save Attribute'));
$this->buttonList->update('save', 'class', 'save primary');
$this->buttonList->update(
'save',
'data_attribute',
['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]
);

if ($this->getRequest()->getParam('popup')) {
$this->buttonList->remove('back');
if ($this->getRequest()->getParam('product_tab') != 'variations') {
Expand All @@ -64,6 +74,8 @@ protected function _construct()
100
);
}
$this->buttonList->update('reset', 'level', 10);
$this->buttonList->update('save', 'class', 'save action-secondary');
} else {
$this->addButton(
'save_and_edit_button',
Expand All @@ -79,14 +91,6 @@ protected function _construct()
);
}

$this->buttonList->update('save', 'label', __('Save Attribute'));
$this->buttonList->update('save', 'class', 'save primary');
$this->buttonList->update(
'save',
'data_attribute',
['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]
);

$entityAttribute = $this->_coreRegistry->registry('entity_attribute');
if (!$entityAttribute || !$entityAttribute->getIsUserDefined()) {
$this->buttonList->remove('delete');
Expand All @@ -96,7 +100,7 @@ protected function _construct()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function addButton($buttonId, $data, $level = 0, $sortOrder = 0, $region = 'toolbar')
{
Expand Down

0 comments on commit 59dd0db

Please sign in to comment.