From 386c8ddc49a7bfbdb1148218c7e3260260829b8d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 21 Jan 2014 22:22:48 +0100 Subject: [PATCH] Added support to call a customer callback after object edit is done. --- .../controllers/_application_controller_generic.js.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee index 0b98b9a6b..bbe01ac67 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee @@ -183,6 +183,11 @@ class App.ControllerGenericIndex extends App.Controller edit: (e) => e.preventDefault() item = $(e.target).item( App[ @genericObject ] ) + + if @editCallback + @editCallback(item) + return + new App.ControllerGenericEdit( id: item.id pageData: @pageData @@ -190,6 +195,7 @@ class App.ControllerGenericIndex extends App.Controller ) destroy: (e) -> + e.preventDefault() item = $(e.target).item( App[ @genericObject ] ) new DestroyConfirm( item: item