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