Use subscribe instead of namespace

This commit is contained in:
Kevin Sawicki
2014-02-11 18:13:47 -08:00
parent 1d2c3bce20
commit d49bb2416b

View File

@@ -29,22 +29,21 @@ class CursorView extends View
shouldPauseBlinking: false
initialize: (@cursor, @editorView) ->
@cursor.on 'moved.cursor-view', =>
@subscribe @cursor, 'moved', =>
@needsUpdate = true
@shouldPauseBlinking = true
@cursor.on 'visibility-changed.cursor-view', (visible) =>
@subscribe @cursor, 'visibility-changed', (visible) =>
@needsUpdate = true
@cursor.on 'autoscrolled.cursor-view', =>
@subscribe @cursor, 'autoscrolled', =>
@editorView.requestDisplayUpdate()
@cursor.on 'destroyed.cursor-view', =>
@subscribe @cursor, 'destroyed', =>
@needsRemoval = true
beforeRemove: ->
@editorView.removeCursorView(this)
@cursor.off('.cursor-view')
@stopBlinking()
updateDisplay: ->