modal: allow disabling popupLabel and set default value to auto
This commit is contained in:
parent
fdfafe18fd
commit
0cb6c27c46
3 changed files with 11 additions and 3 deletions
|
|
@ -33,7 +33,7 @@ class Editor {
|
|||
if (propName === 'address' && value === '') {
|
||||
// special case
|
||||
w.props[propName] = '/' + w.props.id
|
||||
} else if (propName === 'label' && value === true) {
|
||||
} else if ((propName === 'label' || propName === 'popupLabel') && value === true) {
|
||||
w.props[propName] = 'auto'
|
||||
} else {
|
||||
w.props[propName] = value !== '' ? value : deepCopy(defaults[w.props.type][propName].value)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue