From e4461d3d29b172ae8d11df1a405492f35a53f664 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Thu, 2 Jun 2016 15:22:47 +0200 Subject: [PATCH] no success --- .../javascripts/supplier/app/controllers/index.js.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/supplier/app/controllers/index.js.coffee b/app/assets/javascripts/supplier/app/controllers/index.js.coffee index c34cc9c2..4ae1e0ca 100644 --- a/app/assets/javascripts/supplier/app/controllers/index.js.coffee +++ b/app/assets/javascripts/supplier/app/controllers/index.js.coffee @@ -9,7 +9,9 @@ App.IndexController = Ember.Controller.extend active_lists: Ember.computed 'lists.@each.state', 'globals.active_section.id', 'lists.@each.table', -> # table needed for when list changes table @get('orders') # trigger orders, otherwise observers are not initialized/triggered (active_orders) if section_id = @get('globals.active_section.id') - lists = @get('lists').filter (l)=>( l.get('table.section.id') == section_id && l.get('state') == 'active' ) + lists = @get('lists').filter (list) => + return false unless list.get('state') is 'active' + list.get('table.section.id') is section_id else lists = @get('lists').filterBy('state', 'active') lists.sortBy('created_at') # Not reversed, oldest on top, start with oldest order first, work your way down :-) Customer happyness