Fossil SCM
quickfix for [59d699710b1ab5d4]
Commit
5cf4dc82e70aa9c82ecb31e4e020140a12f10dd9b1fe03ae4ca7735f9c57118a
Parent
2771beab20d5411…
1 file changed
+5
-1
+5
-1
| --- src/sorttable.js | ||
| +++ src/sorttable.js | ||
| @@ -9,11 +9,11 @@ | ||
| 9 | 9 | ** function. Example: |
| 10 | 10 | ** |
| 11 | 11 | ** <table class='sortable' data-column-types='tnkx' data-init-sort='2'> |
| 12 | 12 | ** |
| 13 | 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 | |
| 14 | +** the table. The value of data-column-types is a string where each | |
| 15 | 15 | ** character of the string represents a datatype for one column in the |
| 16 | 16 | ** table. |
| 17 | 17 | ** |
| 18 | 18 | ** t Sort by text |
| 19 | 19 | ** n Sort numerically |
| @@ -86,18 +86,22 @@ | ||
| 86 | 86 | hdrCell.className = clsName; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | this.sortText = function(a,b) { |
| 90 | 90 | var i = thisObject.sortIndex; |
| 91 | + if (a.cells.length<=i) return -1; /* see ticket 59d699710b1ab5d4 */ | |
| 92 | + if (b.cells.length<=i) return 1; | |
| 91 | 93 | aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 92 | 94 | bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 93 | 95 | if(aa<bb) return -1; |
| 94 | 96 | if(aa==bb) return a.rowIndex-b.rowIndex; |
| 95 | 97 | return 1; |
| 96 | 98 | } |
| 97 | 99 | this.sortReverseText = function(a,b) { |
| 98 | 100 | var i = thisObject.sortIndex; |
| 101 | + if (a.cells.length<=i) return 1; /* see ticket 59d699710b1ab5d4 */ | |
| 102 | + if (b.cells.length<=i) return -1; | |
| 99 | 103 | aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 100 | 104 | bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase(); |
| 101 | 105 | if(aa<bb) return +1; |
| 102 | 106 | if(aa==bb) return a.rowIndex-b.rowIndex; |
| 103 | 107 | return -1; |
| 104 | 108 |
| --- 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 |