mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-26 00:46:52 +00:00
parent
1b0eec143e
commit
8cc236b4dc
@ -317,8 +317,18 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
|
|||||||
var self = this;
|
var self = this;
|
||||||
titles.sort(function(a,b) {
|
titles.sort(function(a,b) {
|
||||||
if(sortField !== "title") {
|
if(sortField !== "title") {
|
||||||
a = self.getTiddler(a).fields[sortField] || "";
|
var tiddlerA = self.getTiddler(a),
|
||||||
b = self.getTiddler(b).fields[sortField] || "";
|
tiddlerB = self.getTiddler(b);
|
||||||
|
if(tiddlerA) {
|
||||||
|
a = tiddlerA.fields[sortField] || "";
|
||||||
|
} else {
|
||||||
|
a = "";
|
||||||
|
}
|
||||||
|
if(tiddlerB) {
|
||||||
|
b = tiddlerB.fields[sortField] || "";
|
||||||
|
} else {
|
||||||
|
b = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(isNumeric) {
|
if(isNumeric) {
|
||||||
a = Number(a);
|
a = Number(a);
|
||||||
|
Loading…
Reference in New Issue
Block a user