mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Fixed destroy to not break stopListening, which uses off.
This commit is contained in:
parent
f55cef5ced
commit
e9b3db2eb9
2 changed files with 7 additions and 3 deletions
app
|
@ -1,7 +1,8 @@
|
|||
# Template for classes with common functions, like hooking into the Mediator.
|
||||
utils = require './utils'
|
||||
classCount = 0
|
||||
makeScopeName = -> "class-scope-#{classCount++}"
|
||||
makeScopeName = -> "class-scope-#{classCount++}"
|
||||
doNothing = ->
|
||||
|
||||
module.exports = class CocoClass
|
||||
subscriptions: {}
|
||||
|
@ -25,7 +26,8 @@ module.exports = class CocoClass
|
|||
@stopListeningToShortcuts()
|
||||
@[key] = undefined for key of @
|
||||
@destroyed = true
|
||||
@destroy = ->
|
||||
@off = doNothing
|
||||
@destroy = doNothing
|
||||
|
||||
# subscriptions
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ visibleModal = null
|
|||
waitingModal = null
|
||||
classCount = 0
|
||||
makeScopeName = -> "view-scope-#{classCount++}"
|
||||
doNothing = ->
|
||||
|
||||
module.exports = class CocoView extends Backbone.View
|
||||
startsLoading: false
|
||||
|
@ -45,7 +46,8 @@ module.exports = class CocoView extends Backbone.View
|
|||
$('#modal-wrapper .modal').off 'hidden.bs.modal', @modalClosed
|
||||
@[key] = undefined for key, value of @
|
||||
@destroyed = true
|
||||
@destroy = ->
|
||||
@off = doNothing
|
||||
@destroy = doNothing
|
||||
|
||||
afterInsert: ->
|
||||
|
||||
|
|
Loading…
Reference in a new issue