fix: dialog class should have "window" class to get propert buttons

This commit is contained in:
Yohan Boniface 2024-06-14 20:45:17 +02:00
parent 418cd06bb0
commit b747b347f4

View file

@ -4,7 +4,8 @@ import { translate } from '../i18n.js'
export default class Dialog { export default class Dialog {
constructor(parent) { constructor(parent) {
this.parent = parent this.parent = parent
this.container = DomUtil.create('dialog', 'umap-dialog window', this.parent) this.className = 'umap-dialog window'
this.container = DomUtil.create('dialog', this.className, this.parent)
DomEvent.disableClickPropagation(this.container) DomEvent.disableClickPropagation(this.container)
DomEvent.on(this.container, 'contextmenu', DomEvent.stopPropagation) // Do not activate our custom context menu. DomEvent.on(this.container, 'contextmenu', DomEvent.stopPropagation) // Do not activate our custom context menu.
DomEvent.on(this.container, 'wheel', DomEvent.stopPropagation) DomEvent.on(this.container, 'wheel', DomEvent.stopPropagation)
@ -35,7 +36,7 @@ export default class Dialog {
else this.container.show() else this.container.show()
if (className) { if (className) {
// Reset // Reset
this.container.className = 'umap-dialog' this.container.className = this.className
this.container.classList.add(...className.split(' ')) this.container.classList.add(...className.split(' '))
} }
const buttonsContainer = DomUtil.create('ul', 'buttons', this.container) const buttonsContainer = DomUtil.create('ul', 'buttons', this.container)