Skip to content

Commit

Permalink
issue iStefo#24 - expose internal select2 settings
Browse files Browse the repository at this point in the history
  • Loading branch information
s.volevach committed Mar 22, 2017
1 parent 42e4376 commit 6a09414
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addon/components/select-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ var Select2Component = Ember.Component.extend({
return self.get('cssClass') || '';
};

// override options
options = this.customizeOptions(options);

this._select = this.$().select2(options);

this._select.on("change", run.bind(this, function() {
Expand Down Expand Up @@ -441,6 +444,13 @@ var Select2Component = Ember.Component.extend({
this.removeObserver('value', this.valueChanged);
},

/**
* override options
*/
customizeOptions: function(options) {
return options;
}

/**
* Respond to selection changes originating from the select2 element. If
* select2 is working with full objects just use them to set the value,
Expand Down

0 comments on commit 6a09414

Please sign in to comment.