modal: allow disabling popupLabel and set default value to auto

This commit is contained in:
bordun 2020-04-30 09:49:07 +02:00
parent fdfafe18fd
commit 0cb6c27c46
3 changed files with 11 additions and 3 deletions

View file

@ -30,7 +30,7 @@ class Modal extends Panel {
_modalWidgets: 'modal: popup',
popupLabel: {type: 'string', value: '', help: 'Alternative label for the modal popup'},
popupLabel: {type: 'string|boolean', value: 'auto', help: 'Alternative label for the modal popup'},
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'},
@ -229,8 +229,11 @@ class Modal extends Panel {
if (!this.popup) return
var label = this.getProp('popupLabel') ? iconify(this.getProp('popupLabel')) : this.label.innerHTML
var label = this.getProp('popupLabel') !== 'auto' ? iconify(this.getProp('popupLabel')) : this.label.innerHTML
DOM.get(this.popup, '.popup-title .popup-label')[0].innerHTML = label
this.popup.classList.toggle('no-label', this.getProp('popupLabel') === false)
this.labelChange = false
}