sorting data at parsing for consistent editing
handle blank input in editor (return default value)
This commit is contained in:
parent
e9f458d258
commit
5e7a90bc5b
2 changed files with 9 additions and 3 deletions
|
|
@ -72,8 +72,9 @@ enableEditor = function(){
|
|||
`)
|
||||
input.appendTo(form)
|
||||
input.on('change',function(){
|
||||
var v = $(this).data('type') == 'object'?JSON.parse($(this).val()):$(this).val()
|
||||
var v = $(this).val()!= '' && $(this).data('type') == 'object'?JSON.parse($(this).val()):$(this).val()
|
||||
data[$(this).attr('title')]= v=='true'||v=='false'?eval(v):v
|
||||
if (v=='') delete data[$(this).attr('title')]
|
||||
updateWidget()
|
||||
})
|
||||
|
||||
|
|
@ -185,8 +186,9 @@ enableEditor = function(){
|
|||
`)
|
||||
input.appendTo(form)
|
||||
input.on('change',function(){
|
||||
var v = $(this).data('type') == 'object'?JSON.parse($(this).val()):$(this).val()
|
||||
var v = $(this).val()!= '' && $(this).data('type') == 'object'?JSON.parse($(this).val()):$(this).val()
|
||||
data[$(this).attr('title')]= v=='true'||v=='false'?eval(v):v
|
||||
if (v=='') delete data[$(this).attr('title')]
|
||||
updateSession()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,11 @@ parsewidgets = function(widgets,parent) {
|
|||
style = styleW + ';' + styleH
|
||||
|
||||
|
||||
|
||||
for (k in widgetOptions[widgetData.type]) {
|
||||
var tmp = widgetData[k]
|
||||
delete widgetData[k]
|
||||
widgetData[k] = tmp
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue