mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-05 11:32:23 +02:00
don't update hash/attrib immediately on move start
Makes panning snappier by avoiding non-critical operations at the very start.
This commit is contained in:
@@ -28,7 +28,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!
|
||||
}, 500);
|
||||
}, 500, {leading: false});
|
||||
|
||||
function hashchange() {
|
||||
if (location.hash === s0) return; // ignore spurious hashchange events
|
||||
|
||||
@@ -73,7 +73,7 @@ iD.ui.Attribution = function(context) {
|
||||
.on('change.attribution', update);
|
||||
|
||||
context.map()
|
||||
.on('move.attribution', _.throttle(update, 400));
|
||||
.on('move.attribution', _.throttle(update, 400, {leading: false}));
|
||||
|
||||
update();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user