mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
Throttle hash changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user