Added present-but-empty list-after functionality (#3219)

This places the list item at the end of the list when its 'list-item' field
is an empty string.
print-window-tiddler
Cameron Fischer 2018-04-24 11:58:09 -04:00 zatwierdzone przez Jeremy Ruston
rodzic 7f1541464a
commit 7e58866499
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -18,7 +18,7 @@ icon: The title of the tiddler containing the icon associated with a tiddler
library: If set to "yes" indicates that a tiddler should be saved as a JavaScript library
list: An ordered list of tiddler titles associated with a tiddler
list-before: If set, the title of a tiddler before which this tiddler should be added to the ordered list of tiddler titles, or at the start of the list if this field is present but empty
list-after: If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles
list-after: If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles, or at the end of the list if this field is present but empty
modified: The date and time at which a tiddler was last modified
modifier: The tiddler title associated with the person who last modified a tiddler
name: The human readable name associated with a plugin tiddler

Wyświetl plik

@ -569,6 +569,8 @@ exports.sortByList = function(array,listTitle) {
afterTitle = tiddler.fields["list-after"];
if(beforeTitle === "") {
newPos = 0;
} else if(afterTitle === "") {
newPos = titles.length;
} else if(beforeTitle) {
newPos = titles.indexOf(beforeTitle);
} else if(afterTitle) {