Revert "Listen for mouse events on scrollView instead of renderedLines"

You can't listen on scroll view because that makes
it impossible to scroll using the scrollbar

Opens #464

This reverts commit fdae5fd89c.
This commit is contained in:
Corey Johnson
2013-04-29 15:07:38 -07:00
parent fdae5fd89c
commit 9180060920
2 changed files with 84 additions and 87 deletions

View File

@@ -835,12 +835,13 @@ class Editor extends View
$(clickedElement).trigger(e)
false if @isFocused
@scrollView.on 'mousedown', '.fold.line', (e) =>
@renderedLines.on 'mousedown', '.fold.line', (e) =>
@destroyFold($(e.currentTarget).attr('fold-id'))
false
@scrollView.on 'mousedown', (e) =>
onMouseDown = (e) =>
clickCount = e.originalEvent.detail
screenPosition = @screenPositionFromMouseEvent(e)
if clickCount == 1
if e.metaKey
@@ -856,6 +857,8 @@ class Editor extends View
@selectOnMousemoveUntilMouseup() unless e.ctrlKey or e.originalEvent.which > 1
@renderedLines.on 'mousedown', onMouseDown
@on "textInput", (e) =>
@insertText(e.originalEvent.data)
false