modal: add relative geometry property

This commit is contained in:
bordun 2020-11-15 11:26:23 +01:00
parent 0cd3db8583
commit c893241313
4 changed files with 20 additions and 2 deletions

View file

@ -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`<label></label>`