From 1e54b1bcc9bd59fee20370e3d28ca1e2bd5132f3 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 20 Jan 2014 11:53:26 +0000 Subject: [PATCH] Remove empty tag fields in the field mangler This means that removing the last tag from a tiddler will remove the tags field. --- core/modules/widgets/fieldmangler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/modules/widgets/fieldmangler.js b/core/modules/widgets/fieldmangler.js index 86e6fd823..aeeb66b80 100644 --- a/core/modules/widgets/fieldmangler.js +++ b/core/modules/widgets/fieldmangler.js @@ -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)); } }