From d76b8948b3bab23361bc2e2fe5ecea70abde49e2 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 22 Jan 2015 23:12:41 +0000 Subject: [PATCH] Make doubleclick-follow also set zoom, like clicking the follow arrow does. --- public_html/script.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 1813ff7..21c96b8 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -851,15 +851,22 @@ function selectPlaneByHex(hex,autofollow) { SelectedPlane = null; } - FollowSelected = (autofollow ? true : false); + if (SelectedPlane !== null && autofollow) { + FollowSelected = true; + if (GoogleMap.getZoom() < 8) + GoogleMap.setZoom(8); + } else { + FollowSelected = false; + } + refreshSelected(); } function toggleFollowSelected() { FollowSelected = !FollowSelected; - refreshSelected(); if (FollowSelected && GoogleMap.getZoom() < 8) GoogleMap.setZoom(8); + refreshSelected(); } function resetMap() {