diff --git a/addon/components/ember-chosen.js b/addon/components/ember-chosen.js index d9841fb..06ded2a 100644 --- a/addon/components/ember-chosen.js +++ b/addon/components/ember-chosen.js @@ -44,6 +44,7 @@ export default Ember.Component.extend({ } } + _this.$().val(currentValue).trigger("chosen:updated"); _this.$().chosen(options) .on('change', function (e, params) { var index; diff --git a/blueprints/ember-cli-chosen/index.js b/blueprints/ember-cli-chosen/index.js old mode 100644 new mode 100755 index bc1037f..55463bd --- a/blueprints/ember-cli-chosen/index.js +++ b/blueprints/ember-cli-chosen/index.js @@ -4,7 +4,7 @@ module.exports = { afterInstall: function(options) { return this.addBowerPackagesToProject([ - { name: 'chosen=https://github.com/harvesthq/chosen/releases/download/v1.3.0/chosen_v1.3.0.zip' } + { name: 'chosen=~1.4.0' } ]); } }; diff --git a/index.js b/index.js old mode 100644 new mode 100755 index 2eafb59..2ca65c9 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ module.exports = { 'importChosenCSS': true }, app.options['ember-cli-chosen'] || {}); - options.chosenJSType = options.jQuery ? 'jquery' : 'proto'; + options.chosenJSType = options.jQuery ? 'jquery.min' : 'proto'; // Update `ember-cli-chosen` options on our `app` with updated hash app.options['ember-cli-chosen'] = options; @@ -24,7 +24,7 @@ module.exports = { app.import(app.bowerDirectory + '/chosen/chosen.' + options.chosenJSType + '.js'); // Import Chosen CSS (done by default) - if(options.importChosenCSS) { app.import(app.bowerDirectory + '/chosen/chosen.css'); } + if(options.importChosenCSS) { app.import(app.bowerDirectory + '/chosen/chosen.min.css'); } }, treeForPublic: function(treeName) { var tree;