editor: reallow editing disabled properties

This commit is contained in:
jean-emmanuel 2018-05-31 12:13:32 +02:00
parent 9c00b50321
commit bcccf7e2b5
3 changed files with 5 additions and 7 deletions

View file

@ -3,7 +3,9 @@
## 0.32.2
- widgets
- xy: tiny knob style change
- xy: tiny knob style change
- editor
- reallow editing disabled properties
## 0.32.1

View file

@ -22,7 +22,7 @@ module.exports = function editField(editor, widget, propName, defaultValue){
if (widget.props.type == 'tab' || widget.props.type == 'root') return
input = DOM.create(`<select class="input" title="${propName}" ${disabled ? 'disabled' : ''}/>`)
input = DOM.create(`<select class="input" title="${propName}"/>`)
for (let category in widgetCategories) {
input.innerHTML += `<optgroup label="> ${category}">`
@ -42,7 +42,7 @@ module.exports = function editField(editor, widget, propName, defaultValue){
var value = typeof widget.props[propName] !== 'string' ?
JSON.stringify(widget.props[propName], null, ' ').replace(/\n\s\s\s\s/g, ' ').replace(/\n\s\s(\}|\])/g, ' $1') : widget.props[propName]
input = DOM.create(`<textarea class="input" title="${propName}" rows="${value.split('\n').length}" ${disabled ? 'disabled' : ''}>${value}</textarea>`)
input = DOM.create(`<textarea class="input" title="${propName}" rows="${value.split('\n').length}">${value}</textarea>`)
DOM.addEventListener(input, ['input', 'focus'], ()=>{
input.setAttribute('rows',0)

View file

@ -58,10 +58,6 @@
label {
color: var(--color-text-fade);
}
label + * {
pointer-events: none;
opacity: .75;
}
}
label {
background: var(--color-fg);