Reenabled unbind and undelegate of content area.

This commit is contained in:
Martin Edenhofer 2012-10-25 23:27:12 +02:00
parent ac05ce5121
commit 46e56b821f
2 changed files with 13 additions and 4 deletions

View file

@ -24,6 +24,11 @@ class App.Event
_instance ?= new _Singleton _instance ?= new _Singleton
_instance.unbindLevel(level) _instance.unbindLevel(level)
@_allBindings: ->
if _instance == undefined
_instance ?= new _Singleton
_instance._allBindings()
class _Singleton class _Singleton
constructor: -> constructor: ->
@ -80,3 +85,6 @@ class _Singleton
eventList = events.split(' ') eventList = events.split(' ')
for event in eventList for event in eventList
Spine.trigger event, data Spine.trigger event, data
_allBindings: ->
@eventCurrent

View file

@ -46,22 +46,23 @@ class App.Content extends Spine.Controller
# remove events for page # remove events for page
App.Event.unbindLevel('page') App.Event.unbindLevel('page')
# unbind in controller area
@el.unbind()
@el.undelegate()
# send current controller # send current controller
params_only = {} params_only = {}
for i of params for i of params
if typeof params[i] isnt 'object' if typeof params[i] isnt 'object'
params_only[i] = params[i] params_only[i] = params[i]
# tell server what we are calling right now
App.WebSocket.send( App.WebSocket.send(
action: 'active_controller', action: 'active_controller',
controller: route, controller: route,
params: params_only, params: params_only,
) )
# unbind in controller area
# @el.unbind()
# @el.undelegate()
# remove waypoints # remove waypoints
$('footer').waypoint('remove') $('footer').waypoint('remove')