fix zoom resetting wrongly when switching background mid-transition

see https://github.com/openstreetmap/iD/issues/10700#issuecomment-2832010049
This commit is contained in:
Martin Raifer
2025-04-26 20:47:50 +02:00
parent 8c421b615d
commit fa91fe7c0d
12 changed files with 57 additions and 76 deletions
+8 -10
View File
@@ -54,17 +54,15 @@ export function rendererFeatures(context) {
function update() {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
var disabled = features.disabled();
if (disabled.length) {
hash.disable_features = disabled.join(',');
} else {
delete hash.disable_features;
}
window.location.replace('#' + utilQsString(hash, true));
prefs('disabled-features', disabled.join(','));
const hash = utilStringQs(window.location.hash);
const disabled = features.disabled();
if (disabled.length) {
hash.disable_features = disabled.join(',');
} else {
delete hash.disable_features;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
prefs('disabled-features', disabled.join(','));
_hidden = features.hidden();
dispatch.call('change');
dispatch.call('redraw');