Merge pull request #1985 from ajaxorg/focus

fix issue with scrolling into view on focus
This commit is contained in:
Ruben Daniels 2014-06-16 12:34:23 +02:00
commit 5496351529
2 changed files with 27 additions and 19 deletions

View file

@ -47,7 +47,11 @@ var MouseHandler = function(editor) {
new DefaultGutterHandler(this);
new DragdropHandler(this);
var focusEditor = function(e) { editor.focus() };
var focusEditor = function(e) {
if (!editor.isFocused() && editor.textInput)
editor.textInput.onContextMenu(e);
editor.focus()
};
var mouseTarget = editor.renderer.getMouseEventTarget();
event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"));