From 04a9e9ee6aa906b3b3690e39eeebc679df0a9fb3 Mon Sep 17 00:00:00 2001 From: eliot piering Date: Tue, 7 Jul 2015 12:26:35 -0500 Subject: [PATCH 1/2] triggering the 'chosen:updated' event with the initial currentValue so that ember-chosen will show initial values --- addon/components/ember-chosen.js | 1 + 1 file changed, 1 insertion(+) 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; From 10794c4a0e274aea4cdcbc10eb4d151d39169875 Mon Sep 17 00:00:00 2001 From: Eliot Date: Mon, 14 Dec 2015 10:25:27 -0600 Subject: [PATCH 2/2] changing install process --- blueprints/ember-cli-chosen/index.js | 2 +- index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 blueprints/ember-cli-chosen/index.js mode change 100644 => 100755 index.js 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;