Throttle hash changes

This commit is contained in:
Tom MacWright
2012-11-01 10:59:56 -04:00
parent 75d9331233
commit 2e39f47d36
+2 -2
View File
@@ -22,10 +22,10 @@ iD.Hash = function() {
"/" + center.lon.toFixed(precision);
};
function move() {
var move = _.throttle(function() {
var s1 = formatter(map);
if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map!
}
}, 1000);
function hashchange() {
if (location.hash === s0) return; // ignore spurious hashchange events