diff --git a/umap/static/umap/js/modules/ui/dialog.js b/umap/static/umap/js/modules/ui/dialog.js index 417f82bc..01204180 100644 --- a/umap/static/umap/js/modules/ui/dialog.js +++ b/umap/static/umap/js/modules/ui/dialog.js @@ -19,8 +19,18 @@ export default class Dialog { this.container.close() } + currentZIndex() { + return Math.max( + ...Array.from(document.querySelectorAll('dialog')).map( + (el) => window.getComputedStyle(el).getPropertyValue('z-index') || 0 + ) + ) + } + open({ className, content, modal } = {}) { this.container.innerHTML = '' + const currentZIndex = this.currentZIndex() + if (currentZIndex) this.container.style.zIndex = currentZIndex + 1 if (modal) this.container.showModal() else this.container.show() if (className) {