Better speccing and cleanup in between commit

This commit is contained in:
2014-08-15 13:12:47 +02:00
parent 9c570fdbcd
commit 4ab9f63b33
19 changed files with 14 additions and 552 deletions
@@ -72,7 +72,15 @@ root.Qsupplier=
else if e.event == 'orders_placed_count'
$('.supplier-orders-placed-count-number').text e.data.count
else if e.event == 'list_changed_table'
App && App.List.updateOrAdd(e.data.list)
# App && App.List.updateOrAdd(e.data.list)
# App.store().update 'list', e.data.list
#TODO: waiting for single source of truth
if list = App.List.findCached(e.data.list.id)
list.get('table').set('active_list', null)
App.store().findById('table', e.data.list.table_id).then (new_table)->
list.set('table', new_table)
new_table.set('active_list', list) # making reverse association
else if e.event == 'order_cancelled'
if App and order = App.Order.findCached(e.data.id)
order.markCancelled()