Improved error handling.

This commit is contained in:
Martin Edenhofer 2012-10-23 15:54:55 +02:00
parent 2023ce00b5
commit 94b7d1dff5
2 changed files with 6 additions and 3 deletions

View file

@ -49,7 +49,7 @@ class App.ControllerGenericNew extends App.ControllerModal
if ui.callback
ui.callback( user )
ui.modalHide()
App.Collection.find( ui.pageData.object, @id, callbackReload , true )
App.Collection.find( ui['genericObject'], @id, callbackReload , true )
error: ->
ui.log 'errors'
@ -110,7 +110,7 @@ class App.ControllerGenericEdit extends App.ControllerModal
if ui.callback
ui.callback( user )
ui.modalHide()
App.Collection.find( ui.pageData.object, @id, callbackReload , true )
App.Collection.find( ui['genericObject'], @id, callbackReload , true )
error: =>
ui.log 'errors'

View file

@ -235,7 +235,10 @@ class _Singleton
App[type].fetch()
_sortBy: ( collection, attribute ) ->
_.sortBy( collection, (item) -> return item[ attribute ].toLowerCase() )
_.sortBy( collection, (item) ->
return '' if item[ attribute ] is undefined || item[ attribute ] is null
return item[ attribute ].toLowerCase()
)
_filter: ( collection, filter ) ->
for key, value of filter