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 inCompostion = false;
|
||||||
var copied = false;
|
var copied = false;
|
||||||
|
var tempStyle = '';
|
||||||
|
|
||||||
function sendText(valueToSend) {
|
function sendText(valueToSend) {
|
||||||
if (!copied) {
|
if (!copied) {
|
||||||
|
|
@ -191,6 +192,8 @@ var TextInput = function(parentNode, host) {
|
||||||
|
|
||||||
this.onContextMenu = function(mousePos, isEmpty){
|
this.onContextMenu = function(mousePos, isEmpty){
|
||||||
if (mousePos) {
|
if (mousePos) {
|
||||||
|
if(!tempStyle)
|
||||||
|
tempStyle = text.style.cssText;
|
||||||
text.style.cssText = 'position:fixed; z-index:1000;' +
|
text.style.cssText = 'position:fixed; z-index:1000;' +
|
||||||
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'
|
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'
|
||||||
|
|
||||||
|
|
@ -201,10 +204,12 @@ var TextInput = function(parentNode, host) {
|
||||||
|
|
||||||
this.onContextMenuClose = function(){
|
this.onContextMenuClose = function(){
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
if (tempStyle) {
|
||||||
|
text.style.cssText = tempStyle;
|
||||||
|
tempStyle = '';
|
||||||
|
}
|
||||||
sendText();
|
sendText();
|
||||||
}, 0);
|
}, 0);
|
||||||
text.style.position = '';
|
|
||||||
text.style.zIndex = '';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue