mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
wip: deal with multiple dialog z-index
This commit is contained in:
parent
b7dd771a7f
commit
c599082eca
1 changed files with 10 additions and 0 deletions
|
@ -19,8 +19,18 @@ export default class Dialog {
|
||||||
this.container.close()
|
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 } = {}) {
|
open({ className, content, modal } = {}) {
|
||||||
this.container.innerHTML = ''
|
this.container.innerHTML = ''
|
||||||
|
const currentZIndex = this.currentZIndex()
|
||||||
|
if (currentZIndex) this.container.style.zIndex = currentZIndex + 1
|
||||||
if (modal) this.container.showModal()
|
if (modal) this.container.showModal()
|
||||||
else this.container.show()
|
else this.container.show()
|
||||||
if (className) {
|
if (className) {
|
||||||
|
|
Loading…
Reference in a new issue