1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-14 09:36:48 +00:00

Edit text widgets should use default text for missing fields

This commit is contained in:
jeremy@jermolene.com 2021-03-31 14:15:01 +01:00
parent 55e44a9554
commit d6ea369f5e

View File

@ -103,7 +103,11 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
var tiddler = this.wiki.getTiddler(this.editTitle);
if(tiddler) {
// If we've got a tiddler, the value to display is the field string value
value = tiddler.getFieldString(this.editField);
if(tiddler.hasField(this.editField)) {
value = tiddler.getFieldString(this.editField);
} else {
value = this.editDefault || "";
}
if(this.editField === "text") {
type = tiddler.fields.type || "text/vnd.tiddlywiki";
}