|
1 |
| -/*! AlphabetSearch for DataTables v1.2.3 |
| 1 | +/*! AlphabetSearch for DataTables v1.2.4 |
2 | 2 | * 2014 SpryMedia Ltd - datatables.net/license
|
3 | 3 | * Gyrocode - MIT License
|
4 | 4 | */
|
|
7 | 7 | * @summary AlphabetSearch
|
8 | 8 | * @description Show an set of alphabet buttons alongside a table providing
|
9 | 9 | * search input options
|
10 |
| - * @version 1.2.3 |
| 10 | + * @version 1.2.4 |
11 | 11 | * @file dataTables.alphabetSearch.js
|
12 | 12 | * @author SpryMedia Ltd (www.sprymedia.co.uk)
|
13 | 13 | * @contact www.sprymedia.co.uk/contact
|
@@ -94,28 +94,29 @@ $.fn.dataTable.ext.order['alphabetSearch'] = function ( context, col )
|
94 | 94 | }
|
95 | 95 |
|
96 | 96 | var data = this.api().column( col, { order: 'index' } ).data().map( function (value, index) {
|
| 97 | + var letter = value.replace(/<.*?>/g, '').charAt(0).toUpperCase(); |
| 98 | + |
97 | 99 | // If sorting by alphabetized column
|
98 | 100 | return (order_col === context.alphabetSearch.column)
|
99 |
| - ? ( |
100 |
| - // If first pass |
101 |
| - ( !context.alphabetSearch.pass ) |
102 |
| - // Ignore |
103 |
| - ? |
104 |
| - '' |
105 |
| - // Otherwise, if it's a second pass |
106 |
| - : |
107 |
| - ( |
108 |
| - // If method is ascending sort |
109 |
| - ( order_method === 'asc' ) |
110 |
| - // Return first letter |
111 |
| - ? value.charAt(0) |
112 |
| - : String.fromCharCode(65535 - value.charCodeAt(0)) |
113 |
| - ) |
114 |
| - ) |
115 |
| - // Otherwise, if sorting by column other than the one being alphabetized, |
116 |
| - // return first letter |
117 |
| - : value.charAt(0); |
118 |
| - |
| 101 | + ? ( |
| 102 | + // If first pass |
| 103 | + ( !context.alphabetSearch.pass ) |
| 104 | + // Ignore |
| 105 | + ? |
| 106 | + '' |
| 107 | + // Otherwise, if it's a second pass |
| 108 | + : |
| 109 | + ( |
| 110 | + // If method is ascending sort |
| 111 | + ( order_method === 'asc' ) |
| 112 | + // Return first letter |
| 113 | + ? letter |
| 114 | + : String.fromCharCode(65535 - letter.charCodeAt(0)) |
| 115 | + ) |
| 116 | + ) |
| 117 | + // Otherwise, if sorting by column other than the one being alphabetized, |
| 118 | + // return first letter |
| 119 | + : letter; |
119 | 120 | } );
|
120 | 121 |
|
121 | 122 | // If sorting by alphabetized column
|
|
0 commit comments