1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Modified fieldmangler to create a tiddler if adding a tag to one that doesn't exist

This came up as an issue and I don't have any reason it shouldn't be here. It could be useful.
This commit is contained in:
jed 2015-10-08 20:39:19 +02:00
parent 5faba15446
commit 4c95dc9bbb

View File

@ -135,6 +135,10 @@ FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
$tw.utils.pushTop(modification.tags,tag);
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
}
} else if(typeof event.param === "string" && event.param.trim() !== "" && this.mangleTitle.trim() !== "") {
var tag = [];
tag.push(event.param.trim());
this.wiki.addTiddler({title: this.mangleTitle, tags: tag});
}
return true;
};