Get copy paste back

This commit is contained in:
Garen Torikian 2012-04-24 23:16:59 -07:00
commit db264306c9
2 changed files with 10 additions and 0 deletions

View file

@ -430,6 +430,10 @@ var Editor = function(renderer, session) {
return text;
};
this.onCopy = function() {
this.commands.exec("copy", this);
};
this.onCut = function() {
this.commands.exec("cut", this);
};

View file

@ -61,6 +61,7 @@ var TextInput = function(parentNode, host) {
var copied = false;
var pasted = false;
var tempStyle = '';
var outsideCopyText = "";
function select() {
try {
@ -174,6 +175,11 @@ var TextInput = function(parentNode, host) {
outsideCopyText = text.value;
}
this.emitPaste = function() {
pasted = true;
sendText(outsideCopyText);
}
event.addCommandKeyListener(text, host.onCommandKey.bind(host));
if (useragent.isOldIE) {