modal: revert modal containment except in modals/tabs
This commit is contained in:
parent
29ad18de8c
commit
0be90dd155
2 changed files with 22 additions and 2 deletions
|
|
@ -59,7 +59,7 @@
|
|||
- plots/sliders/pads: reversed `logScale` behavior to match standard implementations; can be either `false` (disabled), `true` (logarithmic scale) or `number` (manual log scale, negative for exponential scale)
|
||||
- visualizer: added `framerate` property
|
||||
- menu: always centered menu
|
||||
- modal: modals can't overflow their parents' (modal, tab, panel) boundaries
|
||||
- modal: modals can't overflow parent modal/tab boundaries
|
||||
- input: removed `vertical`
|
||||
- pads, range: when `touchAddress` is set, one message per touched point is sent, in addition to the former touch state message
|
||||
- eq: removed `logScaleX` property, always draw logarithmic frequency response
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue