Remove empty tag fields in the field mangler

This means that removing the last tag from a tiddler will remove the
tags field.
print-window-tiddler
Jermolene 2014-01-20 11:53:26 +00:00
rodzic d3c421985c
commit 1e54b1bcc9
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -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));
}
}