mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-27 22:26:44 +02:00
Merge pull request #2027 from mourner/master
Don't throttle update on hash change, fixes #2023
This commit is contained in:
@@ -25,15 +25,17 @@ iD.behavior.Hash = function(context) {
|
||||
}), true);
|
||||
};
|
||||
|
||||
var move = _.throttle(function() {
|
||||
function update() {
|
||||
var s1 = formatter(context.map());
|
||||
if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map!
|
||||
}, 500, {leading: false});
|
||||
}
|
||||
|
||||
var move = _.throttle(update, 500, {leading: false});
|
||||
|
||||
function hashchange() {
|
||||
if (location.hash === s0) return; // ignore spurious hashchange events
|
||||
if (parser(context.map(), (s0 = location.hash).substring(1))) {
|
||||
move(); // replace bogus hash
|
||||
update(); // replace bogus hash
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user