lib/volt/page/tasks.rb in volt-0.4.8 vs lib/volt/page/tasks.rb in volt-0.4.9
- old
+ new
@@ -33,10 +33,12 @@
response(callback_id, *args)
when 'changed'
changed(*args)
when 'added'
added(*args)
+ when 'removed'
+ removed(*args)
when 'reload'
reload
end
end
@@ -57,9 +59,15 @@
def added(path, data)
$loading_models = true
puts "Add: #{path.inspect} - #{data.inspect}"
$page.store.send(path) << data
+ $loading_models = false
+ end
+
+ def removed(id)
+ $loading_models = true
+ Store.from_id(id).delete!
$loading_models = false
end
def reload
puts "RELOAD"
\ No newline at end of file