auto-reload compare/results model, cleanup

This commit is contained in:
Matthew Dillon 2015-07-14 07:59:29 -08:00
parent 8bdc31f99e
commit cd082ef616
4 changed files with 22 additions and 5 deletions

View file

@ -1,6 +1,22 @@
import Ember from 'ember';
export default Ember.Route.extend({
queryParams: {
strain_ids: {
refreshModel: true,
},
characteristic_ids: {
refreshModel: true,
},
},
beforeModel: function(transition) {
this._super(transition);
if (Ember.$.isEmptyObject(transition.queryParams)) {
this.transitionTo('protected.compare');
}
},
model: function(params) {
let compare = this.controllerFor('protected.compare');
compare.set('selectedStrains', params.strain_ids);