|
4 | 4 | ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5 | 5 | █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6 | 6 | */
|
7 |
| -/*! tablesorter (FORK) - updated 05-16-2017 (v2.28.10)*/ |
| 7 | +/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/ |
8 | 8 | /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9 | 9 | (function(factory) {
|
10 | 10 | if (typeof define === 'function' && define.amd) {
|
|
16 | 16 | }
|
17 | 17 | }(function(jQuery) {
|
18 | 18 |
|
19 |
| -/*! TableSorter (FORK) v2.28.10 *//* |
| 19 | +/*! TableSorter (FORK) v2.28.11 *//* |
20 | 20 | * Client-side table sorting with ease!
|
21 | 21 | * @requires jQuery v1.2.6+
|
22 | 22 | *
|
|
40 | 40 | 'use strict';
|
41 | 41 | var ts = $.tablesorter = {
|
42 | 42 |
|
43 |
| - version : '2.28.10', |
| 43 | + version : '2.28.11', |
44 | 44 |
|
45 | 45 | parsers : [],
|
46 | 46 | widgets : [],
|
|
3149 | 3149 |
|
3150 | 3150 | })(jQuery);
|
3151 | 3151 |
|
3152 |
| -/*! Widget: columns */ |
| 3152 | +/*! Widget: columns - updated 5/24/2017 (v2.28.11) */ |
3153 | 3153 | ;(function ($) {
|
3154 | 3154 | 'use strict';
|
3155 | 3155 | var ts = $.tablesorter || {};
|
3156 | 3156 |
|
3157 | 3157 | ts.addWidget({
|
3158 | 3158 | id: 'columns',
|
3159 |
| - priority: 30, |
| 3159 | + priority: 65, |
3160 | 3160 | options : {
|
3161 | 3161 | columns : [ 'primary', 'secondary', 'tertiary' ]
|
3162 | 3162 | },
|
|
3228 | 3228 |
|
3229 | 3229 | })(jQuery);
|
3230 | 3230 |
|
3231 |
| -/*! Widget: filter - updated 4/18/2017 (v2.28.8) *//* |
| 3231 | +/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//* |
3232 | 3232 | * Requires tablesorter v2.8+ and jQuery 1.7+
|
3233 | 3233 | * by Rob Garrison
|
3234 | 3234 | */
|
|
4046 | 4046 | if ( event.which === tskeyCodes.escape ) {
|
4047 | 4047 | // make sure to restore the last value on escape
|
4048 | 4048 | this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
|
4049 |
| - // live search |
4050 |
| - } else if ( liveSearch === false ) { |
4051 |
| - return; |
4052 | 4049 | // don't return if the search value is empty ( all rows need to be revealed )
|
4053 | 4050 | } else if ( this.value !== '' && (
|
4054 | 4051 | // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
|
|
4057 | 4054 | ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
|
4058 | 4055 | ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
|
4059 | 4056 | return;
|
| 4057 | + // live search |
| 4058 | + } else if ( liveSearch === false ) { |
| 4059 | + if ( this.value !== '' && event.which !== tskeyCodes.enter ) { |
| 4060 | + return; |
| 4061 | + } |
4060 | 4062 | }
|
4061 | 4063 | // change event = no delay; last true flag tells getFilters to skip newest timed input
|
4062 | 4064 | tsf.searching( table, true, true, column );
|
4063 | 4065 | })
|
4064 | 4066 | // include change for select - fixes #473
|
4065 |
| - .bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) { |
| 4067 | + .bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) { |
4066 | 4068 | // don't get cached data, in case data-column changes dynamically
|
4067 | 4069 | var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
|
| 4070 | + eventType = event.type, |
4068 | 4071 | liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
|
4069 | 4072 | wo.filter_liveSearch :
|
4070 | 4073 | ts.getColumnData( table, wo.filter_liveSearch, column );
|
4071 | 4074 | if ( table.config.widgetOptions.filter_initialized &&
|
4072 | 4075 | // immediate search if user presses enter
|
4073 | 4076 | ( event.which === tskeyCodes.enter ||
|
4074 |
| - // immediate search if a "search" is triggered on the input |
4075 |
| - event.type === 'search' || |
| 4077 | + // immediate search if a "search" or "blur" is triggered on the input |
| 4078 | + ( eventType === 'search' || eventType === 'blur' ) || |
4076 | 4079 | // change & input events must be ignored if liveSearch !== true
|
4077 |
| - ( event.type === 'change' || event.type === 'input' ) && |
| 4080 | + ( eventType === 'change' || eventType === 'input' ) && |
4078 | 4081 | // prevent search if liveSearch is a number
|
4079 |
| - liveSearch === true && |
| 4082 | + ( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) && |
4080 | 4083 | // don't allow 'change' or 'input' event to process if the input value
|
4081 | 4084 | // is the same - fixes #685
|
4082 | 4085 | this.value !== c.lastSearch[column]
|
|
4085 | 4088 | event.preventDefault();
|
4086 | 4089 | // init search with no delay
|
4087 | 4090 | $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
|
4088 |
| - tsf.searching( table, event.type !== 'keypress', true, column ); |
| 4091 | + tsf.searching( table, eventType !== 'keypress', true, column ); |
4089 | 4092 | }
|
4090 | 4093 | });
|
4091 | 4094 | },
|
|
0 commit comments