Back off on replacing the location to 1/5 of previous throttle

This commit is contained in:
Tom MacWright
2013-02-05 17:59:26 -05:00
parent f12b7d0fca
commit 356fd6edd5

View File

@@ -29,7 +29,7 @@ iD.behavior.Hash = function(context) {
var move = _.throttle(function() {
var s1 = formatter(context.map());
if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map!
}, 100);
}, 500);
function hashchange() {
if (location.hash === s0) return; // ignore spurious hashchange events