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')