forked from MapComplete/MapComplete
Close popup after splitting; scroll popup into view
This commit is contained in:
parent
057c3fde4f
commit
a7da5d65cf
4 changed files with 17 additions and 17 deletions
|
@ -45,20 +45,6 @@ export default class SelectedFeatureHandler {
|
|||
|
||||
const self = this
|
||||
hash.addCallback(() => self.setSelectedElementFromHash())
|
||||
|
||||
state.featurePipeline?.newDataLoadedSignal?.addCallbackAndRunD((_) => {
|
||||
// New data was loaded. In initial startup, the hash might be set (via the URL) but might not be selected yet
|
||||
if (hash.data === undefined || SelectedFeatureHandler._no_trigger_on.has(hash.data)) {
|
||||
// This is an invalid hash anyway
|
||||
return
|
||||
}
|
||||
if (state.selectedElement.data !== undefined) {
|
||||
// We already have something selected
|
||||
return
|
||||
}
|
||||
self.setSelectedElementFromHash()
|
||||
})
|
||||
|
||||
this.initialLoad()
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@ export default class ElementsState extends FeatureSwitchState {
|
|||
constructor(layoutToUse: LayoutConfig) {
|
||||
super(layoutToUse)
|
||||
|
||||
this.selectedElement.addCallbackAndRun((e) => {
|
||||
console.trace("Selected element is now", e)
|
||||
})
|
||||
function localStorageSynced(
|
||||
key: string,
|
||||
deflt: number,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue