forked from MapComplete/MapComplete
Further fixes to clear up the fullscreen
This commit is contained in:
parent
482a81b40a
commit
558265eba9
9 changed files with 50 additions and 17 deletions
|
|
@ -18,7 +18,9 @@ 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();
|
||||
|
|
|
|||
|
|
@ -49,6 +49,15 @@ export default class Hash {
|
|||
}
|
||||
hash.setData(newValue)
|
||||
}
|
||||
|
||||
window.addEventListener('popstate', e => {
|
||||
let newValue = window.location.hash.substr(1);
|
||||
console.log("Popstate: the hash is now:", newValue)
|
||||
if (newValue === "") {
|
||||
newValue = undefined;
|
||||
}
|
||||
hash.setData(newValue)
|
||||
})
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue