fix issue with scrolling into view on focus

This commit is contained in:
nightwing 2014-05-23 14:13:23 +04:00
commit 66866121e9
2 changed files with 27 additions and 19 deletions

View file

@ -46,7 +46,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"));