diff --git a/CHANGELOG.md b/CHANGELOG.md index 239fa1e7..676a1e3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ As of this version, packages except the `node` package are bundled with a midi b - widgets - keyboard: add `velocity` property (allows mapping the touch coordinates between `off` (top) and `on` (bottom)) - input: add `validation` property (allows defining a regular expression that the value must match) + - modal: add `relative` geometry property + - midi - accept sending sysex strings without spaces between the bytes - load prebuilt midi binary on 64bit linux/windows/osx diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 949b5856..7d37eeec 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -21,6 +21,7 @@ class Modal extends Panel { }, geometry: { _separator_modal_geometry: 'Modal geometry', + relative: {type: 'boolean', value: false, help: 'Set to `true` to make the modal\'s position and size relative to the button\'s.'}, popupWidth: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'}, popupHeight: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'}, popupLeft: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'}, @@ -114,7 +115,7 @@ class Modal extends Panel { this.init = false this.labelChange = true - + this.container.classList.toggle('relative', this.getProp('relative')) this.popupContent.classList.add('layout-' + this.getProp('layout')) this.label = html`` diff --git a/src/scss/ui/modal.scss b/src/scss/ui/modal.scss index b16a8adc..582e0c45 100644 --- a/src/scss/ui/modal.scss +++ b/src/scss/ui/modal.scss @@ -17,7 +17,7 @@ $padding: 8rem; bottom:0; background: black; opacity: .3; - pointer-events: none; + // pointer-events: none; // animation: popup-backdrop-fade-in .25s forwards; } diff --git a/src/scss/widgets/containers.scss b/src/scss/widgets/containers.scss index bba397ce..b128ced1 100644 --- a/src/scss/widgets/containers.scss +++ b/src/scss/widgets/containers.scss @@ -515,6 +515,21 @@ } + &.relative { + > .popup { + left: auto; + right: auto; + top: auto; + bottom: auto; + position: absolute; + width: var(--width, 100%); + height: var(--height, 100%); + margin-top: calc(-1 * var(--widget-spacing)); + margin-left: calc(-1 * var(--widget-spacing)); + padding: var(--widget-spacing); + } + } + } .modal-breakout {