From 904e5c4c7a2c34ec757dd68be2e0325b485af5b4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 18 Oct 2013 08:26:33 +0200 Subject: [PATCH] Improved GenericIndex widget. --- .../_application_controller_generic.js.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ad9ef94e9..9efd77c9c 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee @@ -112,7 +112,8 @@ class App.ControllerGenericIndex extends App.Controller @navupdate @pageData.navupdate # bind render after a change is done - @subscribeId = App[ @genericObject ].subscribe(@render) + if !@disableRender + @subscribeId = App[ @genericObject ].subscribe(@render) App[ @genericObject ].bind 'ajaxError', (rec, msg) => @log 'error', 'ajax', msg.status @@ -126,10 +127,12 @@ class App.ControllerGenericIndex extends App.Controller @render() # fetch all - App[ @genericObject ].fetch() + if !@disableInitFetch + App[ @genericObject ].fetch() release: => - App[ @genericObject ].unsubscribe(@subscribeId) + if @subscribeId + App[ @genericObject ].unsubscribe(@subscribeId) render: =>