Fix scroll buttons in player list
This commit is contained in:
parent
0562b4e485
commit
7e0c81258b
1 changed files with 8 additions and 2 deletions
|
|
@ -292,13 +292,19 @@ DynMap.prototype = {
|
||||||
|
|
||||||
var updateHeight = function() {
|
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
|
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);
|
upbtn.toggle(scrollable);
|
||||||
downbtn.toggle(scrollable);
|
downbtn.toggle(scrollable);
|
||||||
};
|
};
|
||||||
updateHeight();
|
updateHeight();
|
||||||
$(window).resize(updateHeight);
|
$(window).resize(updateHeight);
|
||||||
|
$(dynmap).bind('playeradded', function() {
|
||||||
|
updateHeight();
|
||||||
|
});
|
||||||
|
$(dynmap).bind('playerremoved', function() {
|
||||||
|
updateHeight();
|
||||||
|
});
|
||||||
// The Compass
|
// The Compass
|
||||||
var compass = $('<div/>')
|
var compass = $('<div/>')
|
||||||
.addClass('compass')
|
.addClass('compass')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue