diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-01-22 02:34:21 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-01-22 02:53:43 +0100 |
commit | df1a866cb6441ab459602349985f509d86c094c0 (patch) | |
tree | a172b7c2a0b85876fed71c29cf01b6bfd2d8c8fb | |
parent | 0c0488cc79f363a2aaebac14d9edca76faf492fc (diff) |
Fix popover absolute placement after unanchoring.
We need to place it under .ol-overlaycontainer-stopevent. Unfortunately
this messes its positions upon entering fullscreen, so we dispose it
instead.
-rw-r--r-- | main.js | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -336,6 +336,12 @@ if (window.location !== window.parent.location) { map.addControl(control); control.addEventListener('enterfullscreen', function() { + const popover = Popover.getInstance(popup); + if (popover !== null) { + /* dispose popover as entering fullscreen messes up its position */ + popover.dispose(); + } + const btn = control.element.getElementsByTagName('button')[0]; btn.classList.replace(classInactive, classActive); btn.title = titleActive; @@ -919,7 +925,7 @@ map.addLayer(new VectorTileLayer({ header.appendChild(btnNext); header.appendChild(btnClose); - const container0 = map.getViewport().querySelector('.ol-overlay-container.ol-selectable'); + const container0 = map.getViewport().getElementsByClassName('ol-overlaycontainer-stopevent')[0]; map.on('singleclick', function(event) { /* clear the features list */ features.length = 0; |