Skip to content

Commit

Permalink
Improved multiple processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Honniball committed Jul 15, 2015
1 parent 7550cd1 commit 1493e68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions addon/components/ember-chosen.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,19 @@ export default Ember.Component.extend({
/*
* Checks to see if a value is selected
*/
_checkSelected: function(value) {
_checkSelected: function(optionValue) {
var that = this,
valueStr = String(value),
selectedValue = that.get('value'),
value = that.get('value'),
selected = false;

if(Ember.$.isArray(value)){
if(Ember.$.inArray(value, selectedValue) !== -1) {
var found = _.indexOf(value, optionValue);

if(found !== -1) {
selected = true;
}
} else {
if(valueStr === String(selectedValue)) {
if(String(value) === String(optionValue)) {
selected = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-chosen",
"version": "0.0.16",
"version": "0.0.17",
"description": "Use Chosen select boxes in your ember project.",
"directories": {
"doc": "doc",
Expand Down

0 comments on commit 1493e68

Please sign in to comment.