1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 00:10:45 +00:00

Remove empty tag fields in the field mangler

This means that removing the last tag from a tiddler will remove the
tags field.
This commit is contained in:
Jermolene 2014-01-20 11:53:26 +00:00
parent d3c421985c
commit 1e54b1bcc9

View File

@ -91,6 +91,9 @@ FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {
var modification = this.wiki.getModificationFields();
modification.tags = (tiddler.fields.tags || []).slice(0);
modification.tags.splice(p,1);
if(modification.tags.length === 0) {
modification.tags = undefined;
}
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
}
}