From 7b96e41ebaf23febdd09f68df1acf6febad11dc5 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 9 Mar 2012 13:43:32 +0000 Subject: Fix bug whereby Firefox did not move the pin from under the help when it appeared. --- web/js/map-OpenLayers.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 101585c07..58d1e21ec 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -236,6 +236,9 @@ $(function(){ fixmystreet.map.moveStart = { zoom: this.getZoom(), center: this.getCenter() }; }); fixmystreet.map.events.register("zoomend", null, function(e){ + if ( fixmystreet.map.moveStart && !fixmystreet.map.moveStart.zoom ) { + return true; // getZoom() on Firefox appears to return null at first? + } if ( !fixmystreet.map.moveStart || !this.getCenter().equals(fixmystreet.map.moveStart.center) ) { // Centre has moved, e.g. by double-click. Same whether zoom in or out fixmystreet.map.pan(-q, -25, { animate: false }); @@ -433,6 +436,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }); $('#side-form, #site-logo').show(); + fixmystreet.map.updateSize(); // might have done, and otherwise Firefox gets confused. /* For some reason on IOS5 if you use the jQuery show method it * doesn't display the JS validation error messages unless you do this * or you cause a screen redraw by changing the phone orientation. -- cgit v1.2.3