diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-09 13:43:32 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-09 13:43:32 +0000 |
commit | 7b96e41ebaf23febdd09f68df1acf6febad11dc5 (patch) | |
tree | c3dfa275497dd0b49041022ac7286bf8a46d6d2b /web/js/map-OpenLayers.js | |
parent | 1dfc915c3546ca508c2964c12cf890c8f90e7b9a (diff) |
Fix bug whereby Firefox did not move the pin from under the help when it appeared.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 4 |
1 files changed, 4 insertions, 0 deletions
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. |