don't copy empty strings
This commit is contained in:
parent
e6e01a3ed1
commit
fa5c7f3eb3
1 changed files with 13 additions and 6 deletions
|
|
@ -101,18 +101,25 @@ var TextInput = function(parentNode, host) {
|
||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onCopy = function() {
|
var onCopy = function(e) {
|
||||||
copied = true;
|
copied = true;
|
||||||
text.value = host.getCopyText();
|
var copyText = host.getCopyText();
|
||||||
|
if(copyText)
|
||||||
|
text.value = copyText;
|
||||||
|
else
|
||||||
|
e.preventDefault();
|
||||||
text.select();
|
text.select();
|
||||||
copied = true;
|
|
||||||
setTimeout(sendText, 0);
|
setTimeout(sendText, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onCut = function() {
|
var onCut = function(e) {
|
||||||
copied = true;
|
copied = true;
|
||||||
text.value = host.getCopyText();
|
var copyText = host.getCopyText();
|
||||||
|
if(copyText) {
|
||||||
|
text.value = copyText;
|
||||||
host.onCut();
|
host.onCut();
|
||||||
|
} else
|
||||||
|
e.preventDefault();
|
||||||
text.select();
|
text.select();
|
||||||
setTimeout(sendText, 0);
|
setTimeout(sendText, 0);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue