From 46e56b821f54dfd83248ae57df8d8660741c0bb6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 25 Oct 2012 23:27:12 +0200 Subject: [PATCH] Reenabled unbind and undelegate of content area. --- app/assets/javascripts/app/lib/event.js.coffee | 8 ++++++++ .../javascripts/app/lib/interface_handle.js.coffee | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/lib/event.js.coffee b/app/assets/javascripts/app/lib/event.js.coffee index 3bbfe3b56..99c8238cf 100644 --- a/app/assets/javascripts/app/lib/event.js.coffee +++ b/app/assets/javascripts/app/lib/event.js.coffee @@ -24,6 +24,11 @@ class App.Event _instance ?= new _Singleton _instance.unbindLevel(level) + @_allBindings: -> + if _instance == undefined + _instance ?= new _Singleton + _instance._allBindings() + class _Singleton constructor: -> @@ -80,3 +85,6 @@ class _Singleton eventList = events.split(' ') for event in eventList Spine.trigger event, data + + _allBindings: -> + @eventCurrent \ No newline at end of file diff --git a/app/assets/javascripts/app/lib/interface_handle.js.coffee b/app/assets/javascripts/app/lib/interface_handle.js.coffee index 7147b21d8..341325939 100644 --- a/app/assets/javascripts/app/lib/interface_handle.js.coffee +++ b/app/assets/javascripts/app/lib/interface_handle.js.coffee @@ -46,22 +46,23 @@ class App.Content extends Spine.Controller # remove events for page App.Event.unbindLevel('page') + # unbind in controller area + @el.unbind() + @el.undelegate() + # send current controller params_only = {} for i of params if typeof params[i] isnt 'object' params_only[i] = params[i] + # tell server what we are calling right now App.WebSocket.send( action: 'active_controller', controller: route, params: params_only, ) - # unbind in controller area -# @el.unbind() -# @el.undelegate() - # remove waypoints $('footer').waypoint('remove')