1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00

Proof of concept to change type of tiddlers created by editing missing.

This commit is contained in:
Michael McDermott 2024-08-10 18:15:11 -05:00
parent 4da27f6a4b
commit d94aa9badb

View File

@ -277,6 +277,7 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
}
// Get the current value of the tiddler we're editing
var tiddler = this.wiki.getTiddler(targetTitle);
var defaultFields = { type: "text/markdown" };
// Save the initial value of the draft tiddler
draftTitle = this.generateDraftTitle(targetTitle);
var draftTiddler = new $tw.Tiddler({
@ -288,7 +289,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
"draft.title": targetTitle,
"draft.of": targetTitle
},
this.wiki.getModificationFields()
this.wiki.getModificationFields(),
tiddler == null ? defaultFields : {}
);
this.wiki.addTiddler(draftTiddler);
return draftTiddler;