Stop whole-line selection on gutter clicks.

This commit is contained in:
Nick Winter 2014-11-13 10:54:50 -08:00
parent 05a3577de9
commit 01d6c6d239

View file

@ -106,6 +106,7 @@ module.exports = class SpellView extends CocoView
@toggleControls null, @writable
@aceSession.selection.on 'changeCursor', @onCursorActivity
$(@ace.container).find('.ace_gutter').on 'click mouseenter', '.ace_error, .ace_warning, .ace_info', @onAnnotationClick
$(@ace.container).find('.ace_gutter').on 'click', @onGutterClick
@initAutocomplete aceConfig.liveCompletion ? true
createACEShortcuts: ->
@ -796,6 +797,9 @@ module.exports = class SpellView extends CocoView
# @ is the gutter element
Backbone.Mediator.publish 'tome:jiggle-problem-alert', {}
onGutterClick: =>
@ace.clearSelection()
onDisableControls: (e) -> @toggleControls e, false
onEnableControls: (e) -> @toggleControls e, @writable
toggleControls: (e, enabled) ->
@ -882,6 +886,7 @@ module.exports = class SpellView extends CocoView
destroy: ->
$(@ace?.container).find('.ace_gutter').off 'click', '.ace_error, .ace_warning, .ace_info', @onAnnotationClick
$(@ace?.container).find('.ace_gutter').off 'click', @onGutterClick
@firepad?.dispose()
@ace?.commands.removeCommand command for command in @aceCommands
@ace?.destroy()