From 94fbf5ba08e1ea833eb48228b09b91be0aa22b05 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 13 May 2013 04:12:02 +0100 Subject: [PATCH] fix enabling/disabling of layer chooser portal levels so it works correctly - was broken at L8 --- code/request_handling.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/request_handling.js b/code/request_handling.js index e7ac50b8..b77a29ba 100644 --- a/code/request_handling.js +++ b/code/request_handling.js @@ -69,8 +69,11 @@ window.renderUpdateStatus = function() { t += ''; var portalSelection = $('.leaflet-control-layers-overlays label'); - portalSelection.slice(0, minlvl+1).addClass('disabled').attr('title', 'Zoom in to show those.'); - portalSelection.slice(minlvl, 8).removeClass('disabled').attr('title', ''); + //it's an array - 0=unclaimed, 1=lvl 1, 2=lvl 2, ..., 8=lvl 8 - 9 relevant entries + //mark all levels below (but not at) minlvl as disabled + portalSelection.slice(0, minlvl).addClass('disabled').attr('title', 'Zoom in to show those.'); + //and all from minlvl to 8 as enabled + portalSelection.slice(minlvl, 8+1).removeClass('disabled').attr('title', ''); $('#updatestatus').html(t);