mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 07:26:54 +00:00
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.
This commit is contained in:
parent
7f1541464a
commit
7e58866499
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user