Get copy paste back
This commit is contained in:
parent
2e4d326b3f
commit
db264306c9
2 changed files with 10 additions and 0 deletions
|
|
@ -430,6 +430,10 @@ var Editor = function(renderer, session) {
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onCopy = function() {
|
||||||
|
this.commands.exec("copy", this);
|
||||||
|
};
|
||||||
|
|
||||||
this.onCut = function() {
|
this.onCut = function() {
|
||||||
this.commands.exec("cut", this);
|
this.commands.exec("cut", this);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ var TextInput = function(parentNode, host) {
|
||||||
var copied = false;
|
var copied = false;
|
||||||
var pasted = false;
|
var pasted = false;
|
||||||
var tempStyle = '';
|
var tempStyle = '';
|
||||||
|
var outsideCopyText = "";
|
||||||
|
|
||||||
function select() {
|
function select() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -174,6 +175,11 @@ var TextInput = function(parentNode, host) {
|
||||||
outsideCopyText = text.value;
|
outsideCopyText = text.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.emitPaste = function() {
|
||||||
|
pasted = true;
|
||||||
|
sendText(outsideCopyText);
|
||||||
|
}
|
||||||
|
|
||||||
event.addCommandKeyListener(text, host.onCommandKey.bind(host));
|
event.addCommandKeyListener(text, host.onCommandKey.bind(host));
|
||||||
|
|
||||||
if (useragent.isOldIE) {
|
if (useragent.isOldIE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue