Merge pull request #2626 from atom/iz-mousedown-events-on-left-click-only

Handle mousedown events only for left button in editors
This commit is contained in:
Nathan Sobo 2014-06-16 13:29:37 -06:00
commit 9344e3fc98
2 changed files with 4 additions and 0 deletions

View File

@ -469,6 +469,8 @@ EditorComponent = React.createClass
editor.insertText(char)
onMouseDown: (event) ->
return unless event.button is 0 # only handle the left mouse button
{editor} = @props
{detail, shiftKey, metaKey} = event
screenPosition = @screenPositionForMouseEvent(event)

View File

@ -368,6 +368,8 @@ class EditorView extends View
false if @isFocused
@overlayer.on 'mousedown', (e) =>
return unless e.which is 1 # only handle the left mouse button
@overlayer.hide()
clickedElement = document.elementFromPoint(e.pageX, e.pageY)
@overlayer.show()