1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Incorporating PR feedback.

This commit is contained in:
Michael McDermott 2024-11-26 08:49:40 -06:00
parent 07e56fd09e
commit 837fba040b
2 changed files with 3 additions and 6 deletions

View File

@ -277,8 +277,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
}
// Get the current value of the tiddler we're editing
var tiddler = this.wiki.getTiddler(targetTitle);
var defaultType = this.wiki.getTiddler("$:/config/DefaultMissingType");
var defaultFields = { type: defaultType !== null ? defaultType.fields['text'].trim() : "" };
var defaultType = this.wiki.getTiddlerText("$:/config/DefaultMissingType", "").trim();
var defaultFields = { type: defaultType };
// Save the initial value of the draft tiddler
draftTitle = this.generateDraftTitle(targetTitle);
var draftTiddler = new $tw.Tiddler({
@ -291,7 +291,7 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
"draft.of": targetTitle
},
this.wiki.getModificationFields(),
tiddler == null ? defaultFields : {}
tiddler === null || tiddler === undefined ? defaultFields : {}
);
this.wiki.addTiddler(draftTiddler);
return draftTiddler;

View File

@ -1,3 +0,0 @@
title: $:/config/DefaultMissingType