modal: revert modal containment except in modals/tabs

This commit is contained in:
bordun 2020-04-19 20:31:46 +02:00
parent c049aebc34
commit f497b466c8
2 changed files with 22 additions and 2 deletions

View file

@ -144,10 +144,11 @@ class Modal extends Panel {
this.popup.classList.toggle('show', this.value)
this.container.classList.toggle('on', this.value)
// this.setVisibility()
this.bindEscKey(this.value)
if (this.init) this.fixParents()
if (this.value) {
resize.check(this.widget, true)
}
@ -157,6 +158,25 @@ class Modal extends Panel {
if (options.sync) this.changed(options)
}
fixParents() {
var parent = this.parent,
scrollFixed = false
while (parent && parent.props && !parent.getProp('type').match(/modal|tab|root/)) {
// stacking
parent.container.style.zIndex = this.value ? 'initial' : ''
parent.container.style.contain = this.value ? 'style size' : ''
parent = parent.parent
}
this.container.style.contain = this.value ? 'style size' : ''
}
bindEscKey(set) {