Fix issue where hashtags set in URL parameter would not be honored

This commit is contained in:
Quincy Morgan
2020-04-14 12:25:18 -07:00
parent 3a933de876
commit 417caba3be
2 changed files with 34 additions and 37 deletions

View File

@@ -111,8 +111,8 @@ export function behaviorHash(context) {
}
}
var throttledUpdate = _throttle(updateHashIfNeeded, 500);
var throttledUpdateTitle = _throttle(function() {
var _throttledUpdate = _throttle(updateHashIfNeeded, 500);
var _throttledUpdateTitle = _throttle(function() {
updateTitle(true /* includeChangeCount */);
}, 500);
@@ -164,13 +164,13 @@ export function behaviorHash(context) {
function behavior() {
context.map()
.on('move.behaviorHash', throttledUpdate);
.on('move.behaviorHash', _throttledUpdate);
context.history()
.on('change.behaviorHash', throttledUpdateTitle);
.on('change.behaviorHash', _throttledUpdateTitle);
context
.on('enter.behaviorHash', throttledUpdate);
.on('enter.behaviorHash', _throttledUpdate);
d3_select(window)
.on('hashchange.behaviorHash', hashchange);
@@ -206,8 +206,8 @@ export function behaviorHash(context) {
}
behavior.off = function() {
throttledUpdate.cancel();
throttledUpdateTitle.cancel();
_throttledUpdate.cancel();
_throttledUpdateTitle.cancel();
context.map()
.on('move.behaviorHash', null);