Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Aug 15, 2018
1 parent d25874b commit 499ebca
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/widgets/assets/src/js/select-model-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@

sx.EventManager.bind(this.get('callbackEventName'), function(e, data)
{
self.add(data);
self.add(data, true);
});
},

Expand Down Expand Up @@ -179,7 +179,7 @@
if (this.get('initClientData'))
{
_.each(this.get('initClientData'), function(data, key){
self.add(data);
self.add(data, false);
});
}
},
Expand All @@ -188,8 +188,9 @@
* @param itemData
* @returns {sx.classes.SelectModelDialogMultiple}
*/
add: function(itemData)
add: function(itemData, triggerUpdate)
{
var triggerUpdate = triggerUpdate;
var self = this;

if (_.size(itemData) > 0)
Expand All @@ -215,7 +216,7 @@
var value = self.getVal();
value = _.without(value, String(id));

self.setVal(value);
self.setVal(value, true);

_.delay(function(){
jLi.remove()
Expand All @@ -236,7 +237,7 @@
}

val = _.uniq(val);
self.setVal(val);
self.setVal(val, triggerUpdate);
this.jQueryDeselectBtn.show();
}

Expand Down Expand Up @@ -268,8 +269,10 @@
* @param id
* @returns {sx.classes.SelectModelDialog}
*/
setVal: function(data)
setVal: function(data, triggerUpdate)
{
var triggerUpdate = triggerUpdate;

var self = this;
self.jQueryInput.empty();

Expand All @@ -282,7 +285,9 @@
)
});

this.jQueryInput.change();
if (triggerUpdate) {
this.jQueryInput.change();
}
return this;
},

Expand Down

0 comments on commit 499ebca

Please sign in to comment.