fix for chrome
This commit is contained in:
parent
cad1421cd9
commit
decc10e922
1 changed files with 9 additions and 4 deletions
|
|
@ -50,6 +50,7 @@ var TextInput = function(parentNode, host) {
|
|||
|
||||
var inCompostion = false;
|
||||
var copied = false;
|
||||
var tempStyle = '';
|
||||
|
||||
function sendText(valueToSend) {
|
||||
if (!copied) {
|
||||
|
|
@ -190,21 +191,25 @@ var TextInput = function(parentNode, host) {
|
|||
};
|
||||
|
||||
this.onContextMenu = function(mousePos, isEmpty){
|
||||
if(mousePos){
|
||||
if (mousePos) {
|
||||
if(!tempStyle)
|
||||
tempStyle = text.style.cssText;
|
||||
text.style.cssText = 'position:fixed; z-index:1000;' +
|
||||
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'
|
||||
|
||||
}
|
||||
if(isEmpty)
|
||||
if (isEmpty)
|
||||
text.value='';
|
||||
}
|
||||
|
||||
this.onContextMenuClose = function(){
|
||||
setTimeout(function () {
|
||||
if (tempStyle) {
|
||||
text.style.cssText = tempStyle;
|
||||
tempStyle = '';
|
||||
}
|
||||
sendText();
|
||||
}, 0);
|
||||
text.style.position = '';
|
||||
text.style.zIndex = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue