Created
April 20, 2013 02:57
-
-
Save brian-mann/5424544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do (Backbone) -> | |
_.extend Backbone.Marionette.Application::, | |
register: (instance, id) -> | |
@_registry ?= {} | |
@_registry[id] = instance | |
unregister: (instance, id) -> | |
delete @_registry[id] | |
resetRegistry: -> | |
oldCount = @getRegistrySize() | |
for key, controller of @_registry | |
controller.region.close() | |
msg = "There were #{oldCount} controllers in the registry, there are now #{@getRegistrySize()}" | |
if @getRegistrySize() > 0 then console.warn(msg, @_registry) else console.log(msg) | |
getRegistrySize: -> | |
_.size @_registry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment