aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-02 11:13:19 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-03-02 11:13:19 +0000
commit28032886923829170f5f989c53428fe7a1d8232e (patch)
treeef74e9ccf67d25ca501c57395f88281c91f95eee /web/js/map-OpenLayers.js
parente63bc8af54f40838271f9c0cacf861cdc600c03d (diff)
Fix hashchange not working in IE6 for #246, and better animatino when clicking underneath where the sidebar will appear.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index aec9b69b1..a95325d34 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -264,7 +264,7 @@ $(function(){
return;
}
- if (location.hash) {
+ if (location.hash && location.hash != '#') {
return;
}
@@ -445,8 +445,9 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
var sidebar = $('#report-a-problem-sidebar');
if (sidebar.css('position') == 'absolute') {
var w = sidebar.width(), h = sidebar.height(), o = sidebar.offset();
- if (e.xy.y <= o.top) {
- // top of the page, pin hidden by header
+ if (e.xy.y <= o.top || (e.xy.x >= o.left && e.xy.x <= o.left + w + 24 && e.xy.y >= o.top && e.xy.y <= o.top + h + 64)) {
+ // top of the page, pin hidden by header;
+ // or underneath where the new sidebar will appear
lonlat.transform(
new OpenLayers.Projection("EPSG:4326"),
fixmystreet.map.getProjectionObject()
@@ -455,9 +456,6 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
p.x -= $(window).width() / 3;
lonlat = fixmystreet.map.getLonLatFromViewPortPx(p);
fixmystreet.map.panTo(lonlat);
- } else if (e.xy.x >= o.left && e.xy.x <= o.left + w + 24 && e.xy.y >= o.top && e.xy.y <= o.top + h + 64) {
- // underneath where the new sidebar will appear
- fixmystreet.map.pan(-w, 0, { animate: true });
}
}