Skip to content

Commit

Permalink
Rolling back the change to starting that used localeCompare - it was …
Browse files Browse the repository at this point in the history
…causing incorrect sorting in IE9 (unit test failures)
  • Loading branch information
Allan Jardine committed Dec 15, 2011
1 parent 1e2d1a9 commit b447a0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions media/js/jquery.dataTables.js
Expand Up @@ -10956,17 +10956,17 @@
"string-pre": function ( a )
{
if ( typeof a != 'string' ) { a = ''; }
return a.toLocaleLowerCase();
return a.toLowerCase();
},

"string-asc": function ( x, y )
{
return x.localeCompare(y);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},

"string-desc": function ( x, y )
{
return y.localeCompare(x);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},


Expand All @@ -10975,17 +10975,17 @@
*/
"html-pre": function ( a )
{
return a.replace( /<.*?>/g, "" ).toLocaleLowerCase();
return a.replace( /<.*?>/g, "" ).toLowerCase();
},

"html-asc": function ( x, y )
{
return x.localeCompare(y);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},

"html-desc": function ( x, y )
{
return y.localeCompare(x);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},


Expand Down
12 changes: 6 additions & 6 deletions media/src/ext/ext.sorting.js
Expand Up @@ -6,17 +6,17 @@ $.extend( DataTable.ext.oSort, {
"string-pre": function ( a )
{
if ( typeof a != 'string' ) { a = ''; }
return a.toLocaleLowerCase();
return a.toLowerCase();
},

"string-asc": function ( x, y )
{
return x.localeCompare(y);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},

"string-desc": function ( x, y )
{
return y.localeCompare(x);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},


Expand All @@ -25,17 +25,17 @@ $.extend( DataTable.ext.oSort, {
*/
"html-pre": function ( a )
{
return a.replace( /<.*?>/g, "" ).toLocaleLowerCase();
return a.replace( /<.*?>/g, "" ).toLowerCase();
},

"html-asc": function ( x, y )
{
return x.localeCompare(y);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},

"html-desc": function ( x, y )
{
return y.localeCompare(x);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},


Expand Down

0 comments on commit b447a0d

Please sign in to comment.