editor: assign correct address based on id when emptying the field (#592)
This commit is contained in:
parent
544aab5989
commit
5767a6724d
2 changed files with 7 additions and 2 deletions
|
|
@ -120,7 +120,12 @@ module.exports = function editField(editor, widget, propName, defaultValue){
|
|||
|
||||
var newWidgets = []
|
||||
for (var w of selectedWidgets) {
|
||||
w.props[propName] = v !== '' ? v : deepCopy(defaultValue.value)
|
||||
if (propName === 'address' && v === '') {
|
||||
// special case
|
||||
w.props[propName] = '/' + w.props.id
|
||||
} else {
|
||||
w.props[propName] = v !== '' ? v : deepCopy(defaultValue.value)
|
||||
}
|
||||
newWidgets.push(updateWidget(w, {changedProps: [propName], preventSelect: selectedWidgets.length > 1}))
|
||||
}
|
||||
editor.pushHistory()
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ var Parser = class Parser {
|
|||
props.id = id
|
||||
}
|
||||
|
||||
// Generate default address
|
||||
// Generate default address (also handled in editor/edit-field)
|
||||
props.address = props.address === 'auto' ? '/' + props.id : props.address
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue