forked from MapComplete/MapComplete
Fix rendering of multianswers, other small bug fixes
This commit is contained in:
parent
46254434db
commit
ad08a55517
13 changed files with 68 additions and 62 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import {UIEventSource} from "../UIEventSource";
|
||||
import {UIElement} from "../../UI/UIElement";
|
||||
import FeatureSource from "../FeatureSource/FeatureSource";
|
||||
|
||||
/**
|
||||
|
|
@ -18,9 +17,7 @@ export default class SelectedFeatureHandler {
|
|||
this._featureSource = featureSource;
|
||||
const self = this;
|
||||
hash.addCallback(h => {
|
||||
console.log("SelectedFeatureHandler: hash is now ", h)
|
||||
if (h === undefined || h === "") {
|
||||
console.log("Deselecting...")
|
||||
selectedFeature.setData(undefined);
|
||||
}else{
|
||||
self.selectFeature();
|
||||
|
|
@ -30,7 +27,10 @@ export default class SelectedFeatureHandler {
|
|||
featureSource.features.addCallback(_ => self.selectFeature());
|
||||
|
||||
selectedFeature.addCallback(feature => {
|
||||
hash.setData(feature?.properties?.id ?? "");
|
||||
const h = feature?.properties?.id;
|
||||
if(h !== undefined){
|
||||
hash.setData(h)
|
||||
}
|
||||
})
|
||||
|
||||
this.selectFeature();
|
||||
|
|
@ -51,7 +51,6 @@ export default class SelectedFeatureHandler {
|
|||
if(hash === undefined || hash === "" || hash === "#"){
|
||||
return;
|
||||
}
|
||||
console.log("Selecting a feature from the hash...")
|
||||
for (const feature of features) {
|
||||
const id = feature.feature?.properties?.id;
|
||||
if(id === hash){
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ export default class MetaTagging {
|
|||
tags["_isOpen:oldvalue"] = tags.opening_hours
|
||||
window.setTimeout(
|
||||
() => {
|
||||
console.log("Updating the _isOpen tag for ", tags.id);
|
||||
console.log("Updating the _isOpen tag for ", tags.id, ", it's timer expired after", timeout);
|
||||
updateTags();
|
||||
},
|
||||
timeout
|
||||
|
|
|
|||
|
|
@ -43,16 +43,14 @@ export default class Hash {
|
|||
|
||||
window.onhashchange = () => {
|
||||
let newValue = window.location.hash.substr(1);
|
||||
console.log("The hash is now:", newValue)
|
||||
if (newValue === "") {
|
||||
newValue = undefined;
|
||||
}
|
||||
hash.setData(newValue)
|
||||
}
|
||||
|
||||
window.addEventListener('popstate', e => {
|
||||
window.addEventListener('popstate', _ => {
|
||||
let newValue = window.location.hash.substr(1);
|
||||
console.log("Popstate: the hash is now:", newValue)
|
||||
if (newValue === "") {
|
||||
newValue = undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue