Skip to content

Commit

Permalink
Merge forwardport of #11949 to 2.3-develop branch
Browse files Browse the repository at this point in the history
Applied pull request patch https://github.com/magento/magento2/pull/11949.patch (created by @nmalevanec) based on commit(s):
  1. fbbebdc

Fixed GitHub Issues in 2.3-develop branch:
  - #11868: "Add Products" button has been duplicated after the customer group was changed (reported by @OleksiyOleksiyovych)
  • Loading branch information
magento-engcom-team authored Jan 23, 2018
2 parents 6c02a2d + 5ae2109 commit f2ec2ea
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ define([
}
});

var searchButton = new ControlButton(jQuery.mage.__('Add Products')),
var searchButtonId = 'add_products',
searchButton = new ControlButton(jQuery.mage.__('Add Products'), searchButtonId),
searchAreaId = this.getAreaId('search');
searchButton.onClick = function() {
$(searchAreaId).show();
Expand All @@ -74,7 +75,7 @@ define([

this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) {
proceed();
if ($(searchAreaId) && !$(searchAreaId).visible()) {
if ($(searchAreaId) && !$(searchAreaId).visible() && !$(searchButtonId)) {
this.addControlButton(searchButton);
}
});
Expand Down Expand Up @@ -1383,12 +1384,15 @@ define([
_label: '',
_node: null,

initialize: function(label){
initialize: function(label, id){
this._label = label;
this._node = new Element('button', {
'class': 'action-secondary action-add',
'type': 'button'
});
if (typeof id !== 'undefined') {
this._node.setAttribute('id', id)
}
},

onClick: function(){
Expand Down

0 comments on commit f2ec2ea

Please sign in to comment.