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);
|
||||
};
|
||||
|
||||
var onCopy = function() {
|
||||
var onCopy = function(e) {
|
||||
copied = true;
|
||||
text.value = host.getCopyText();
|
||||
var copyText = host.getCopyText();
|
||||
if(copyText)
|
||||
text.value = copyText;
|
||||
else
|
||||
e.preventDefault();
|
||||
text.select();
|
||||
copied = true;
|
||||
setTimeout(sendText, 0);
|
||||
};
|
||||
|
||||
var onCut = function() {
|
||||
var onCut = function(e) {
|
||||
copied = true;
|
||||
text.value = host.getCopyText();
|
||||
host.onCut();
|
||||
var copyText = host.getCopyText();
|
||||
if(copyText) {
|
||||
text.value = copyText;
|
||||
host.onCut();
|
||||
} else
|
||||
e.preventDefault();
|
||||
text.select();
|
||||
setTimeout(sendText, 0);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue