From eb87231926cc8bdd14015e0cc95e36fea625cb6d Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 13 Jul 2011 16:05:08 -0500 Subject: [PATCH] Fix scroll buttons in player list --- web/js/map.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/js/map.js b/web/js/map.js index e938b49e..60446c92 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -292,13 +292,19 @@ DynMap.prototype = { var updateHeight = function() { playerlist.height(sidebar.innerHeight() - (playerlist.offset().top - worldlist.offset().top) - 64); // here we need a fix to avoid the static value, but it works fine this way :P - var scrollable = playerlist.scrollHeight() > playerlist.height(); + console.log('scrollheight=' + playerlist.scrollHeight() + ', height=' + playerlist.height()); + var scrollable = playerlist.scrollHeight() < playerlist.height(); upbtn.toggle(scrollable); downbtn.toggle(scrollable); }; updateHeight(); $(window).resize(updateHeight); - + $(dynmap).bind('playeradded', function() { + updateHeight(); + }); + $(dynmap).bind('playerremoved', function() { + updateHeight(); + }); // The Compass var compass = $('
') .addClass('compass')