From 1816e153f6cce0195a1834032bf1b53cfe515397 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sun, 10 Feb 2013 20:05:46 +0100 Subject: [PATCH] fix #85 --- code/utils_misc.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index aa8d44a5..de0df1c6 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -141,8 +141,13 @@ window.scrollBottom = function(elm) { } window.zoomToAndShowPortal = function(guid, latlng) { - renderPortalDetails(guid); map.setView(latlng, 17); + // if the data is available, render it immediately. Otherwise defer + // until it becomes available. + if(window.portals[guid]) + renderPortalDetails(guid); + else + urlPortal = guid; } // translates guids to entity types @@ -154,7 +159,7 @@ window.getTypeByGuid = function(guid) { // .b == fields // .c == player/creator // .d == chat messages - // + // // resonator guid is [portal guid]-resonator-[slot] switch(guid.slice(33)) { case '11':