From c350dd6fcc93e1df09ddf57fe325b12551e90342 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 17 Nov 2015 13:10:10 -0700 Subject: [PATCH] Force sort order for compare --- app/pods/protected/compare/select-form/component.js | 8 +++++++- app/pods/protected/compare/select-form/template.hbs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/pods/protected/compare/select-form/component.js b/app/pods/protected/compare/select-form/component.js index 4801506..692be67 100644 --- a/app/pods/protected/compare/select-form/component.js +++ b/app/pods/protected/compare/select-form/component.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -const { Component } = Ember; +const { Component, computed: { sort } } = Ember; export default Component.extend({ characteristics: null, @@ -10,6 +10,12 @@ export default Component.extend({ "update-strains": null, "update-characteristics": null, + + charSortParams: ['characteristicTypeName', 'sortOrder', 'characteristicName'], + sortedCharacteristics: sort('characteristics', 'charSortParams'), + strainSortParams: ['sortOrder'], + sortedStrains: sort('strains', 'sortParams'), + selectedStrains: [], selectedCharacteristics: [], diff --git a/app/pods/protected/compare/select-form/template.hbs b/app/pods/protected/compare/select-form/template.hbs index eaa7713..331535d 100644 --- a/app/pods/protected/compare/select-form/template.hbs +++ b/app/pods/protected/compare/select-form/template.hbs @@ -6,7 +6,7 @@ {{ x-select - options=strains + options=sortedStrains nameAttr='fullNameMU' multiple=true selected=selectedStrains @@ -26,7 +26,7 @@ {{ x-select - options=characteristics + options=sortedCharacteristics nameAttr='characteristicName' multiple=true selected=selectedCharacteristics