From 540fe9dda0b68eacbed2d9cd4a0abdf009f058d9 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sun, 12 May 2013 16:55:28 -0700 Subject: [PATCH] Fix tooltip alignment problems --- js/client-battle.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/client-battle.js b/js/client-battle.js index 84878860a..a33767fff 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -720,6 +720,7 @@ if (x > 335) x = 335; if (y < 140) y = 140; + if (!$('#tooltipwrapper').length) $(document.body).append('
'); $('#tooltipwrapper').css({ left: x, top: y @@ -744,6 +745,7 @@ } text += ''; break; + case 'pokemon': var pokemon = this.battle.getPokemon(thing); if (!pokemon) return; @@ -801,7 +803,6 @@ text += ''; break; } - if (!$('#tooltipwrapper').length) $(document.body).append('
'); $('#tooltipwrapper').html(text).appendTo(document.body); }, hideTooltip: function() {