Added support to call a customer callback after object edit is done.

This commit is contained in:
Martin Edenhofer 2014-01-21 22:22:48 +01:00
parent a122a674e6
commit 386c8ddc49

View file

@ -183,6 +183,11 @@ class App.ControllerGenericIndex extends App.Controller
edit: (e) => edit: (e) =>
e.preventDefault() e.preventDefault()
item = $(e.target).item( App[ @genericObject ] ) item = $(e.target).item( App[ @genericObject ] )
if @editCallback
@editCallback(item)
return
new App.ControllerGenericEdit( new App.ControllerGenericEdit(
id: item.id id: item.id
pageData: @pageData pageData: @pageData
@ -190,6 +195,7 @@ class App.ControllerGenericIndex extends App.Controller
) )
destroy: (e) -> destroy: (e) ->
e.preventDefault()
item = $(e.target).item( App[ @genericObject ] ) item = $(e.target).item( App[ @genericObject ] )
new DestroyConfirm( new DestroyConfirm(
item: item item: item