Fossil SCM

quickfix for [59d699710b1ab5d4]

jkosche 2025-04-06 16:35 trunk merge
Commit 5cf4dc82e70aa9c82ecb31e4e020140a12f10dd9b1fe03ae4ca7735f9c57118a
1 file changed +5 -1
--- src/sorttable.js
+++ src/sorttable.js
@@ -9,11 +9,11 @@
99
** function. Example:
1010
**
1111
** <table class='sortable' data-column-types='tnkx' data-init-sort='2'>
1212
**
1313
** Column data types are determined by the data-column-types attribute of
14
-** the table. The value of data-column-types is a string where each
14
+** the table. The value of data-column-types is a string where each
1515
** character of the string represents a datatype for one column in the
1616
** table.
1717
**
1818
** t Sort by text
1919
** n Sort numerically
@@ -86,18 +86,22 @@
8686
hdrCell.className = clsName;
8787
}
8888
}
8989
this.sortText = function(a,b) {
9090
var i = thisObject.sortIndex;
91
+ if (a.cells.length<=i) return -1; /* see ticket 59d699710b1ab5d4 */
92
+ if (b.cells.length<=i) return 1;
9193
aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
9294
bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
9395
if(aa<bb) return -1;
9496
if(aa==bb) return a.rowIndex-b.rowIndex;
9597
return 1;
9698
}
9799
this.sortReverseText = function(a,b) {
98100
var i = thisObject.sortIndex;
101
+ if (a.cells.length<=i) return 1; /* see ticket 59d699710b1ab5d4 */
102
+ if (b.cells.length<=i) return -1;
99103
aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
100104
bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
101105
if(aa<bb) return +1;
102106
if(aa==bb) return a.rowIndex-b.rowIndex;
103107
return -1;
104108
--- src/sorttable.js
+++ src/sorttable.js
@@ -9,11 +9,11 @@
9 ** function. Example:
10 **
11 ** <table class='sortable' data-column-types='tnkx' data-init-sort='2'>
12 **
13 ** Column data types are determined by the data-column-types attribute of
14 ** the table. The value of data-column-types is a string where each
15 ** character of the string represents a datatype for one column in the
16 ** table.
17 **
18 ** t Sort by text
19 ** n Sort numerically
@@ -86,18 +86,22 @@
86 hdrCell.className = clsName;
87 }
88 }
89 this.sortText = function(a,b) {
90 var i = thisObject.sortIndex;
 
 
91 aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
92 bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
93 if(aa<bb) return -1;
94 if(aa==bb) return a.rowIndex-b.rowIndex;
95 return 1;
96 }
97 this.sortReverseText = function(a,b) {
98 var i = thisObject.sortIndex;
 
 
99 aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
100 bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
101 if(aa<bb) return +1;
102 if(aa==bb) return a.rowIndex-b.rowIndex;
103 return -1;
104
--- src/sorttable.js
+++ src/sorttable.js
@@ -9,11 +9,11 @@
9 ** function. Example:
10 **
11 ** <table class='sortable' data-column-types='tnkx' data-init-sort='2'>
12 **
13 ** Column data types are determined by the data-column-types attribute of
14 ** the table. The value of data-column-types is a string where each
15 ** character of the string represents a datatype for one column in the
16 ** table.
17 **
18 ** t Sort by text
19 ** n Sort numerically
@@ -86,18 +86,22 @@
86 hdrCell.className = clsName;
87 }
88 }
89 this.sortText = function(a,b) {
90 var i = thisObject.sortIndex;
91 if (a.cells.length<=i) return -1; /* see ticket 59d699710b1ab5d4 */
92 if (b.cells.length<=i) return 1;
93 aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
94 bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
95 if(aa<bb) return -1;
96 if(aa==bb) return a.rowIndex-b.rowIndex;
97 return 1;
98 }
99 this.sortReverseText = function(a,b) {
100 var i = thisObject.sortIndex;
101 if (a.cells.length<=i) return 1; /* see ticket 59d699710b1ab5d4 */
102 if (b.cells.length<=i) return -1;
103 aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
104 bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
105 if(aa<bb) return +1;
106 if(aa==bb) return a.rowIndex-b.rowIndex;
107 return -1;
108

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button