fix for chrome

This commit is contained in:
nightwing 2011-01-30 01:26:13 +04:00
commit decc10e922

View file

@ -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 = '';
} }
}; };