modal: cross browser modal breakout
This commit is contained in:
parent
c155d18686
commit
4f0dd29714
3 changed files with 18 additions and 2 deletions
|
|
@ -180,12 +180,18 @@ class Modal extends Panel {
|
|||
|
||||
// stacking
|
||||
parent.container.style.zIndex = this.value ? 'initial' : ''
|
||||
parent.container.style.contain = this.value ? 'size' : ''
|
||||
|
||||
parent.modalBreakout += (this.value ? 1 : -1)
|
||||
if (parent.modalBreakout > 0) parent.container.classList.add('modal-breakout')
|
||||
else if (parent.modalBreakout === 0) parent.container.classList.remove('modal-breakout')
|
||||
|
||||
parent = parent.parent
|
||||
}
|
||||
|
||||
this.container.style.contain = this.value ? 'size' : ''
|
||||
|
||||
this.modalBreakout += (this.value ? 1 : -1)
|
||||
if (this.modalBreakout > 0) this.container.classList.add('modal-breakout')
|
||||
else if (this.modalBreakout === 0) this.container.classList.remove('modal-breakout')
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ class Panel extends Container() {
|
|||
this.container.classList.toggle('no-scroll', !this.getProp('scroll'))
|
||||
this.container.classList.add('layout-' + this.getProp('layout'))
|
||||
|
||||
this.modalBreakout = 0
|
||||
|
||||
var layout = this.getProp('layout')
|
||||
if (layout === 'grid') {
|
||||
|
||||
|
|
|
|||
|
|
@ -484,6 +484,14 @@
|
|||
|
||||
}
|
||||
|
||||
.modal-breakout {
|
||||
contain: size!important;
|
||||
@supports not (contain: strict) {
|
||||
transform: none!important; // cancel new stacking context
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.matrix-container {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue