spine/spine — pull request #471 by maca (2013-06-10 22:35:12+00:00)
Title: Could Spine Manager deactivate non current controllers prior to activating current one?

What I would propose would be deactivating all non current controllers from the controller array and then activating the current one.

https://github.com/maca/spine/blob/dev/src/manager.coffee#L28-33

I want a controller activation to change a global state, but I am finding race conditions (so to speak):

Basically I have some controllers that inherit from Pane, that have a static position on top of the main section, so whenever a Pane is visible I don't want the main page to be scrollable.

class Spine.Pane extends Spine.Controller
activate: ->
$('body').addClass 'noscroll'
super

deactivate: ->
$('body').removeClass 'noscroll'
super