From 9e3984fdcb4c2ccab9d3299f53d8f802a7ade5ad Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 6 Mar 2024 20:01:04 +0100 Subject: [PATCH] wip: do not change panel color if it's not browser Ugly way to do, but for now I haven't found a better option --- umap/static/umap/js/modules/browser.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/modules/browser.js b/umap/static/umap/js/modules/browser.js index 1e80b695..a2230ad6 100644 --- a/umap/static/umap/js/modules/browser.js +++ b/umap/static/umap/js/modules/browser.js @@ -122,9 +122,12 @@ export default class Browser { }) } + isOpen () { + return !!document.querySelector('.umap-browser') + } + onMoveEnd() { - const isBrowserOpen = !!document.querySelector('.umap-browse-data') - if (!isBrowserOpen) return + if (!this.isOpen()) return const isListDynamic = this.options.inBbox this.map.eachBrowsableDataLayer((datalayer) => { if (!isListDynamic && !datalayer.hasDynamicData()) return @@ -184,10 +187,12 @@ export default class Browser { } onEnableEdit () { + if (!this.isOpen()) return this.map.ui._panel.classList.add('dark') } onDisableEdit () { + if (!this.isOpen()) return this.map.ui._panel.classList.remove('dark') } }