fix cut/copy on opera
This commit is contained in:
parent
03af6b599a
commit
22d4427320
2 changed files with 17 additions and 3 deletions
|
|
@ -57,7 +57,6 @@ try {
|
||||||
compat: true,
|
compat: true,
|
||||||
name: "ace"
|
name: "ace"
|
||||||
});
|
});
|
||||||
process.exit(0);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("--- Ace Build error ---");
|
console.log("--- Ace Build error ---");
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
|
||||||
|
|
@ -215,6 +215,22 @@ var TextInput = function(parentNode, host) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if (useragent.isOpera) {
|
||||||
|
event.addListener(parentNode, "keydown", function(e) {
|
||||||
|
if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((e.keyCode == 88 || e.keyCode == 67)) {
|
||||||
|
var copyText = host.getCopyText();
|
||||||
|
if (copyText) {
|
||||||
|
text.value = copyText;
|
||||||
|
text.select();
|
||||||
|
if (e.keyCode == 88)
|
||||||
|
host.onCut();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
event.addListener(text, "copy", onCopy);
|
event.addListener(text, "copy", onCopy);
|
||||||
event.addListener(text, "cut", onCut);
|
event.addListener(text, "cut", onCut);
|
||||||
|
|
@ -264,8 +280,7 @@ var TextInput = function(parentNode, host) {
|
||||||
|
|
||||||
text.style.cssText =
|
text.style.cssText =
|
||||||
'position:fixed; z-index:1000;' +
|
'position:fixed; z-index:1000;' +
|
||||||
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;';
|
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;';
|
||||||
|
|
||||||
}
|
}
|
||||||
if (isEmpty)
|
if (isEmpty)
|
||||||
text.value='';
|
text.value='';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue