Skip to content

Commit

Permalink
11868: "Add Products" button has been duplicated after the customer g…
Browse files Browse the repository at this point in the history
…roup was changed.
  • Loading branch information
nmalevanec committed Nov 2, 2017
1 parent 884d717 commit fbbebdc
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 @@ -1394,12 +1395,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 fbbebdc

Please sign in to comment.