Fix tooltip alignment problems

This commit is contained in:
Guangcong Luo 2013-05-12 16:55:28 -07:00
parent 1ceb5e01d0
commit 540fe9dda0

View File

@ -720,6 +720,7 @@
if (x > 335) x = 335;
if (y < 140) y = 140;
if (!$('#tooltipwrapper').length) $(document.body).append('<div id="tooltipwrapper"></div>');
$('#tooltipwrapper').css({
left: x,
top: y
@ -744,6 +745,7 @@
}
text += '</div></div>';
break;
case 'pokemon':
var pokemon = this.battle.getPokemon(thing);
if (!pokemon) return;
@ -801,7 +803,6 @@
text += '</div></div>';
break;
}
if (!$('#tooltipwrapper').length) $(document.body).append('<div id="tooltipwrapper"></div>');
$('#tooltipwrapper').html(text).appendTo(document.body);
},
hideTooltip: function() {