1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Fix new field value handling in edit template (#3048)

prevents variables in the value from being replaced when adding a new field
This commit is contained in:
Tobias Beer 2018-04-24 23:03:59 +02:00 committed by Jeremy Ruston
parent 61f9adb710
commit f26bcb273b

View File

@ -10,10 +10,13 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
[[hide]] -[title{$(config-title)$}]
\end
\define new-field-inner()
\define new-field()
<$vars name={{$:/temp/newfieldname}}>
<$reveal type="nomatch" text="" default=<<name>>>
<$button>
<$action-sendmessage $message="tm-add-field" $name=<<name>> $value=<<value>>/>
<$action-sendmessage $message="tm-add-field"
$name=<<name>>
$value={{$:/temp/newfieldvalue}}/>
<$action-deletetiddler $tiddler="$:/temp/newfieldname"/>
<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/>
<<lingo Fields/Add/Button>>
@ -24,14 +27,7 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
<<lingo Fields/Add/Button>>
</$button>
</$reveal>
\end
\define new-field()
<$set name="name" value={{$:/temp/newfieldname}}>
<$set name="value" value={{$:/temp/newfieldvalue}}>
<<new-field-inner>>
</$set>
</$set>
</$vars>
\end
<div class="tc-edit-fields">