mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Rename Cursor and CursorView events to passive-voice scheme
Any events emitted from DOM nodes should be prefixed with an identifier for the node that emits them. This eliminates the possibility of ambiguity when the events bubble up the DOM away from their emitter.
This commit is contained in:
@@ -23,11 +23,11 @@ class CursorView extends View
|
||||
@shouldPauseBlinking = true
|
||||
@editor.requestDisplayUpdate()
|
||||
|
||||
@cursor.on 'change-visibility.cursor-view', (visible) =>
|
||||
@cursor.on 'visibility-changed.cursor-view', (visible) =>
|
||||
@needsUpdate = true
|
||||
@editor.requestDisplayUpdate()
|
||||
|
||||
@cursor.on 'destroy.cursor-view', =>
|
||||
@cursor.on 'destroyed.cursor-view', =>
|
||||
@needsRemoval = true
|
||||
@editor.requestDisplayUpdate()
|
||||
|
||||
@@ -43,7 +43,7 @@ class CursorView extends View
|
||||
unless _.isEqual(@lastPixelPosition, pixelPosition)
|
||||
changedPosition = true
|
||||
@css(pixelPosition)
|
||||
@trigger 'cursor-move'
|
||||
@trigger 'cursor:moved'
|
||||
|
||||
if @shouldPauseBlinking
|
||||
@resetBlinking()
|
||||
|
||||
@@ -27,7 +27,7 @@ class Cursor
|
||||
destroy: ->
|
||||
@anchor.destroy()
|
||||
@editSession.removeCursor(this)
|
||||
@trigger 'destroy'
|
||||
@trigger 'destroyed'
|
||||
|
||||
setScreenPosition: (screenPosition, options) ->
|
||||
@goalColumn = null
|
||||
@@ -52,7 +52,7 @@ class Cursor
|
||||
if @visible != visible
|
||||
@visible = visible
|
||||
@needsAutoscroll = @visible and @isLastCursor()
|
||||
@trigger 'change-visibility', @visible
|
||||
@trigger 'visibility-changed', @visible
|
||||
|
||||
isVisible: -> @visible
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Gutter extends View
|
||||
|
||||
editor = @editor()
|
||||
highlightLines = => @highlightLines()
|
||||
editor.on 'cursor-move', highlightLines
|
||||
editor.on 'cursor:moved', highlightLines
|
||||
editor.on 'selection-change', highlightLines
|
||||
@on 'click', '.line-number', (e) =>
|
||||
row = parseInt($(e.target).text()) - 1
|
||||
|
||||
@@ -15,7 +15,7 @@ class Selection
|
||||
@cursor.on 'moved.selection', ({bufferChange}) =>
|
||||
@screenRangeChanged() unless bufferChange
|
||||
|
||||
@cursor.on 'destroy.selection', =>
|
||||
@cursor.on 'destroyed.selection', =>
|
||||
@cursor = null
|
||||
@destroy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user