From fb88b046ccb7759d0bcfc9af076d5d4c5e871878 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 26 Nov 2013 11:26:30 -0800 Subject: [PATCH] Restore leading event for move throttling Hash updates turn out to be very timing sensitive. While it's OK for drag gestures to be throttled with a trailing edge, manual moves such as zooming to a particular feature should always trigger a leading edge update. To recoup the performance, we could refactor the map events to the standard movestart, move, and moveend, and update the hash only on moveend. Fixes #2023 --- js/id/behavior/hash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/id/behavior/hash.js b/js/id/behavior/hash.js index 54c1ead0e..fb6309f6c 100644 --- a/js/id/behavior/hash.js +++ b/js/id/behavior/hash.js @@ -30,7 +30,7 @@ iD.behavior.Hash = function(context) { if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map! } - var move = _.throttle(update, 500, {leading: false}); + var move = _.throttle(update, 500); function hashchange() { if (location.hash === s0) return; // ignore spurious hashchange events