fix autocomplete popup click regression

This commit is contained in:
nightwing 2014-07-02 22:24:20 +04:00
commit f9b3655c94
3 changed files with 11 additions and 6 deletions

View file

@ -67,6 +67,7 @@ var AcePopup = function(parentNode) {
popup.renderer.setStyle("ace_autocomplete");
popup.setOption("displayIndentGuides", false);
popup.setOption("dragDelay", 150);
var noop = function(){};

View file

@ -428,13 +428,17 @@ var TextInput = function(parentNode, host) {
this.onContextMenu = function(e) {
afterContextMenu = true;
if (!tempStyle)
tempStyle = text.style.cssText;
text.style.cssText = "z-index:100000;" + (useragent.isIE ? "opacity:0.1;" : "");
resetSelection(host.selection.isEmpty());
host._emit("nativecontextmenu", {target: host, domEvent: e});
this.moveToMouse(e, true);
};
this.moveToMouse = function(e, bringToFront) {
if (!tempStyle)
tempStyle = text.style.cssText;
text.style.cssText = (bringToFront ? "z-index:100000;" : "")
+ (useragent.isIE ? "opacity:0.1;" : "");
var rect = host.container.getBoundingClientRect();
var style = dom.computedStyle(host.container);
var top = rect.top + (parseInt(style.borderTopWidth) || 0);

View file

@ -49,7 +49,7 @@ var MouseHandler = function(editor) {
var focusEditor = function(e) {
if (!editor.isFocused() && editor.textInput)
editor.textInput.onContextMenu(e);
editor.textInput.moveToMouse(e);
editor.focus()
};