From 6f15bc940d117f6e61392ba6f6054ef291a302ab Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 12 Nov 2015 16:39:02 -0700 Subject: [PATCH] Add characteristics. Select All blocks for way too long. --- app/pods/protected/compare/select-form/component.js | 10 +++++++--- app/pods/protected/compare/select-form/template.hbs | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/pods/protected/compare/select-form/component.js b/app/pods/protected/compare/select-form/component.js index 9c1687d..6c7d0ae 100644 --- a/app/pods/protected/compare/select-form/component.js +++ b/app/pods/protected/compare/select-form/component.js @@ -20,7 +20,7 @@ export default Component.extend({ updateCharacteristics: function(selection) { this.set('selectedCharacteristics', selection); - this.attrs['update-characteristics'](this.get('selectedCharacteristics')); + this.attrs['update-characteristics'](selection); }, actions: { @@ -51,15 +51,19 @@ export default Component.extend({ chars.forEach((char) => { char_ids.push(char.get('id')); }); - this.updateCharacteristics(char_ids.join(",")); + this.updateCharacteristics(char_ids); }, deselectAllCharacteristics: function() { - this.updateCharacteristics(""); + this.updateCharacteristics([]); }, updateStrainSelection: function(selection) { this.updateStrains(selection); }, + + updateCharacteristicSelection: function(selection) { + this.updateCharacteristics(selection); + }, }, }); diff --git a/app/pods/protected/compare/select-form/template.hbs b/app/pods/protected/compare/select-form/template.hbs index 5068a7c..6bf7985 100644 --- a/app/pods/protected/compare/select-form/template.hbs +++ b/app/pods/protected/compare/select-form/template.hbs @@ -25,13 +25,13 @@
  • {{ - select-2 + x-select + listItems=characteristics + nameAttr="characteristicName" + update=(action "updateCharacteristicSelection") + placeholder="Select one ore more characteristics" multiple=true - content=characteristics - value=selectedCharacteristics - optionValuePath="id" - optionLabelPath="characteristicName" - placeholder="Select one or more characteristics" + selected=selectedCharacteristics }}