editor: mark dynamic props

This commit is contained in:
jean-emmanuel 2018-02-13 17:21:40 +01:00
parent f216db4530
commit 6b51dcf113
2 changed files with 12 additions and 1 deletions

View file

@ -49,10 +49,12 @@ var editObject = function(widget, options = {}){
if (i=='type' && (data.type == 'tab' || data.type == 'root')) continue
let dynamic = widgets[data.type].dynamicProps.includes(i)
let type = typeof data[i],
value = type != 'string'?JSON.stringify(data[i], null, ' ').replace(/\n\s\s\s\s/g, ' ').replace(/\n\s\s(\}|\])/g, ' $1'):data[i],
wrapper = $('<div class="input-wrapper"></div>').appendTo(form),
label = $(`<label>${i}</label>`).appendTo(wrapper),
label = $(`<label ${dynamic ? 'class="dynamic" title="dynamic"': ''}>${i}</label>`).appendTo(wrapper),
input
if (i=='type') {

View file

@ -63,6 +63,15 @@
min-width: 29%;
box-shadow: 1rem 0 0 0 var(--color-bg) inset;
margin-top: 1rem;
&.dynamic:after {
content:"\f0e7";
font-family: FontAwesome;
vertical-align:super;
font-size: 75%;
opacity: 0.75!important;
position: absolute;
margin-top: -4rem;
}
}
.input {
background: var(--color-bg);