jquery-tablesorter 1.24.5 → 1.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jquery-tablesorter/version.rb +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +85 -85
- data/vendor/assets/javascripts/jquery-tablesorter/beta-testing/widget-reorder.js +17 -18
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +128 -101
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +70 -58
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +58 -43
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-extract.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-range.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-duration.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-feet-inch-fraction.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-image.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-leading-zeros.js +1 -0
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-named-numbers.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-network.js +4 -4
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-roman.js +5 -5
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +15 -15
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +28 -18
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-chart.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +22 -18
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-html5.js +34 -31
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-jui.js +46 -46
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-select2.js +10 -10
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-type-insideRange.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +17 -13
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-formatter.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +14 -15
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-headerTitles.js +8 -9
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-lazyload.js +35 -35
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +8 -9
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +7 -6
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +60 -56
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-reflow.js +11 -11
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-saveSort.js +23 -12
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +3 -4
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sort2Hash.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js +7 -7
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +5 -6
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-uitheme.js +7 -6
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-vertical-group.js +10 -12
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-view.js +3 -3
- metadata +2 -2
@@ -171,7 +171,6 @@
|
|
171
171
|
if ( hasFilter || !$row.hasClass( filtered ) ) {
|
172
172
|
$cells = $row.children().not( mathIgnore );
|
173
173
|
cellLen = $cells.length;
|
174
|
-
// $row.children().each(function(){
|
175
174
|
for ( cellIndex = 0; cellIndex < cellLen; cellIndex++ ) {
|
176
175
|
$t = $cells.eq( cellIndex );
|
177
176
|
col = math.getCellIndex( $t );
|
@@ -221,7 +220,7 @@
|
|
221
220
|
recalculate : function(c, wo, init) {
|
222
221
|
if ( c && ( !wo.math_isUpdating || init ) ) {
|
223
222
|
|
224
|
-
var
|
223
|
+
var time, mathAttr, $mathCells, indx, len,
|
225
224
|
changed = false,
|
226
225
|
filters = {};
|
227
226
|
if ( c.debug || wo.math_debug ) {
|
@@ -435,7 +434,7 @@
|
|
435
434
|
mask = mask.substring( start, index );
|
436
435
|
|
437
436
|
// convert any string to number according to formation sign.
|
438
|
-
val = mask.charAt( 0 )
|
437
|
+
val = mask.charAt( 0 ) === '-' ? -val : +val;
|
439
438
|
isNegative = val < 0 ? val = -val : 0; // process only abs(), and turn on flag.
|
440
439
|
|
441
440
|
// search for separator for grp & decimal, anything not digit, not +/- sign, not #.
|
@@ -517,7 +516,7 @@
|
|
517
516
|
len = arry.length;
|
518
517
|
if ( len > 1 ) {
|
519
518
|
// https://gist.github.com/caseyjustus/1166258
|
520
|
-
arry.sort( function( a, b ){ return a - b; } );
|
519
|
+
arry.sort( function( a, b ) { return a - b; } );
|
521
520
|
half = Math.floor( len / 2 );
|
522
521
|
return ( len % 2 ) ? arry[ half ] : ( arry[ half - 1 ] + arry[ half ] ) / 2;
|
523
522
|
}
|
@@ -542,7 +541,7 @@
|
|
542
541
|
}
|
543
542
|
}
|
544
543
|
// returns arry of modes if there is a tie
|
545
|
-
return modes.sort( function( a, b ){ return a - b; } );
|
544
|
+
return modes.sort( function( a, b ) { return a - b; } );
|
546
545
|
},
|
547
546
|
max : function(arry) {
|
548
547
|
return Math.max.apply( Math, arry );
|
@@ -551,7 +550,7 @@
|
|
551
550
|
return Math.min.apply( Math, arry );
|
552
551
|
},
|
553
552
|
range: function(arry) {
|
554
|
-
var v = arry.sort( function( a, b ){ return a - b; } );
|
553
|
+
var v = arry.sort( function( a, b ) { return a - b; } );
|
555
554
|
return v[ arry.length - 1 ] - v[ 0 ];
|
556
555
|
},
|
557
556
|
// common variance equation
|
@@ -604,9 +603,9 @@
|
|
604
603
|
// mask info: https://code.google.com/p/javascript-number-formatter/
|
605
604
|
math_mask : '#,##0.00',
|
606
605
|
// complete executed after each fucntion
|
607
|
-
math_complete : null, // function($cell, wo, result, value, arry){ return result; },
|
606
|
+
math_complete : null, // function($cell, wo, result, value, arry) { return result; },
|
608
607
|
// math_completed called after all math calculations have completed
|
609
|
-
math_completed: function( config ) {},
|
608
|
+
math_completed: function( /* config */ ) {},
|
610
609
|
// order of calculation; 'all' is last
|
611
610
|
math_priority : [ 'row', 'above', 'below', 'col' ],
|
612
611
|
// template for or just prepend the mask prefix & suffix with this HTML
|
@@ -639,7 +638,7 @@
|
|
639
638
|
}
|
640
639
|
})
|
641
640
|
.on( update, function() {
|
642
|
-
setTimeout( function(){
|
641
|
+
setTimeout( function() {
|
643
642
|
math.updateComplete( c );
|
644
643
|
}, 40 );
|
645
644
|
});
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
/*jshint browser:true, jquery:true, unused:false */
|
9
9
|
/*global jQuery:false, alert:false */
|
10
|
-
;(function($){
|
10
|
+
;(function($) {
|
11
11
|
'use strict';
|
12
12
|
|
13
13
|
var ts = $.tablesorter,
|
@@ -164,11 +164,12 @@
|
|
164
164
|
headers = output.processRow(c, $this, true, outputJSON);
|
165
165
|
|
166
166
|
// all tbody rows - do not include widget added rows (e.g. grouping widget headers)
|
167
|
-
if ( !$rows )
|
167
|
+
if ( !$rows ) {
|
168
168
|
$rows = $el.children('tbody').children('tr').not(c.selectorRemove);
|
169
|
+
}
|
169
170
|
|
170
171
|
// check for a filter callback function first! because
|
171
|
-
// /^f/.test(function(){ console.log('test'); }) is TRUE! (function is converted to a string)
|
172
|
+
// /^f/.test(function() { console.log('test'); }) is TRUE! (function is converted to a string)
|
172
173
|
$rows = typeof saveRows === 'function' ? $rows.filter(saveRows) :
|
173
174
|
// get (f)iltered, (v)isible, all rows (look for the first letter only), or jQuery filter selector
|
174
175
|
/^f/.test(saveRows) ? $rows.not('.' + (wo.filter_filteredRow || 'filtered') ) :
|
@@ -410,11 +411,11 @@
|
|
410
411
|
output_popupStyle : 'width=500,height=300',
|
411
412
|
output_saveFileName : 'mytable.csv',
|
412
413
|
// format $cell content callback
|
413
|
-
output_formatContent : null, // function(config, widgetOptions, data){ return data.content; }
|
414
|
+
output_formatContent : null, // function(config, widgetOptions, data) { return data.content; }
|
414
415
|
// callback executed when processing completes
|
415
416
|
// return true to continue download/output
|
416
417
|
// return false to stop delivery & do something else with the data
|
417
|
-
output_callback : function(config, data){ return true; },
|
418
|
+
output_callback : function(/* config, data */) { return true; },
|
418
419
|
// JSON callback executed when a colspan is encountered in the header
|
419
420
|
output_callbackJSON : function($cell, txt, cellIndex) { return txt + '(' + (cellIndex) + ')'; },
|
420
421
|
// the need to modify this for Excel no longer exists
|
@@ -429,7 +430,7 @@
|
|
429
430
|
init: function(table, thisWidget, c) {
|
430
431
|
output.init(c);
|
431
432
|
},
|
432
|
-
remove: function(table, c){
|
433
|
+
remove: function(table, c) {
|
433
434
|
output.remove(c);
|
434
435
|
}
|
435
436
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
/*! Widget: Pager - updated
|
1
|
+
/*! Widget: Pager - updated 2018-03-19 (v2.30.1) */
|
2
2
|
/* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
5
5
|
/*jshint browser:true, jquery:true, unused:false */
|
6
|
-
;(function($){
|
6
|
+
;(function($) {
|
7
7
|
'use strict';
|
8
8
|
var tsp,
|
9
9
|
ts = $.tablesorter;
|
@@ -66,7 +66,7 @@
|
|
66
66
|
pager_customAjaxUrl: function( table, url ) { return url; },
|
67
67
|
|
68
68
|
// ajax error callback from $.tablesorter.showError function
|
69
|
-
// pager_ajaxError: function( config, xhr, settings, exception ){ return exception; };
|
69
|
+
// pager_ajaxError: function( config, xhr, settings, exception ) { return exception; };
|
70
70
|
// returning false will abort the error message
|
71
71
|
pager_ajaxError: null,
|
72
72
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
// ],
|
92
92
|
// [ "header1", "header2", ... "headerN" ] // optional
|
93
93
|
// ]
|
94
|
-
pager_ajaxProcessing: function( ajax ){ return [ 0, [], null ]; },
|
94
|
+
pager_ajaxProcessing: function( /* ajax */ ) { return [ 0, [], null ]; },
|
95
95
|
|
96
96
|
// css class names of pager arrows
|
97
97
|
pager_css: {
|
@@ -158,12 +158,15 @@
|
|
158
158
|
setPage: wo.pager_startPage
|
159
159
|
}, c.pager );
|
160
160
|
|
161
|
+
// Used by core appendCache; !undefined is always true
|
162
|
+
p.removeRows = wo.pager_removeRows;
|
163
|
+
|
161
164
|
// pager initializes multiple times before table has completed initialization
|
162
165
|
if ( p.isInitializing ) { return; }
|
163
166
|
|
164
167
|
p.isInitializing = true;
|
165
|
-
if (
|
166
|
-
console.log( 'Pager
|
168
|
+
if ( ts.debug(c, 'pager') ) {
|
169
|
+
console.log( 'Pager >> Initializing' );
|
167
170
|
}
|
168
171
|
|
169
172
|
p.size = $.data( table, 'pagerLastSize' ) || wo.pager_size;
|
@@ -227,8 +230,8 @@
|
|
227
230
|
p.initializing = false;
|
228
231
|
p.isInitializing = false;
|
229
232
|
tsp.setPageSize( c, p.size ); // page size 0 is ignored
|
230
|
-
if (
|
231
|
-
console.log( 'Pager
|
233
|
+
if ( ts.debug(c, 'pager') ) {
|
234
|
+
console.log( 'Pager >> Triggering pagerInitialized' );
|
232
235
|
}
|
233
236
|
c.$table.triggerHandler( 'pagerInitialized', c );
|
234
237
|
// filter widget not initialized; it will update the output display & fire off the pagerComplete event
|
@@ -243,7 +246,8 @@
|
|
243
246
|
p = c.pager,
|
244
247
|
wo = c.widgetOptions,
|
245
248
|
namespace = c.namespace + 'pager',
|
246
|
-
s = wo.pager_selectors
|
249
|
+
s = wo.pager_selectors,
|
250
|
+
debug = ts.debug(c, 'pager');
|
247
251
|
c.$table
|
248
252
|
.off( namespace )
|
249
253
|
.on( 'filterInit filterStart '.split( ' ' ).join( namespace + ' ' ), function( e, filters ) {
|
@@ -284,7 +288,7 @@
|
|
284
288
|
e.stopPropagation();
|
285
289
|
tsp.enablePager( c, true );
|
286
290
|
})
|
287
|
-
.on( 'destroyPager' + namespace, function( e
|
291
|
+
.on( 'destroyPager' + namespace, function( e ) {
|
288
292
|
e.stopPropagation();
|
289
293
|
// call removeWidget to make sure internal flags are modified.
|
290
294
|
ts.removeWidget( c.table, 'pager', false );
|
@@ -343,8 +347,8 @@
|
|
343
347
|
// clicked controls
|
344
348
|
ctrls = [ s.first, s.prev, s.next, s.last ];
|
345
349
|
fxn = [ 'moveToFirstPage', 'moveToPrevPage', 'moveToNextPage', 'moveToLastPage' ];
|
346
|
-
if (
|
347
|
-
console.warn( 'Pager
|
350
|
+
if ( debug && !p.$container.length ) {
|
351
|
+
console.warn( 'Pager >> "container" not found' );
|
348
352
|
}
|
349
353
|
p.$container.find( ctrls.join( ',' ) )
|
350
354
|
.attr( 'tabindex', 0 )
|
@@ -373,8 +377,8 @@
|
|
373
377
|
tsp.moveToPage( c, p, true );
|
374
378
|
tsp.updatePageDisplay( c, false );
|
375
379
|
});
|
376
|
-
} else if (
|
377
|
-
console.warn( 'Pager
|
380
|
+
} else if ( debug ) {
|
381
|
+
console.warn( 'Pager >> "goto" selector not found' );
|
378
382
|
}
|
379
383
|
|
380
384
|
tmp = p.$container.find( wo.pager_selectors.pageSize );
|
@@ -394,8 +398,8 @@
|
|
394
398
|
}
|
395
399
|
return false;
|
396
400
|
});
|
397
|
-
} else if (
|
398
|
-
console.warn('Pager
|
401
|
+
} else if ( debug ) {
|
402
|
+
console.warn('Pager >> "size" selector not found');
|
399
403
|
}
|
400
404
|
|
401
405
|
},
|
@@ -532,8 +536,8 @@
|
|
532
536
|
tsp.pagerArrows( c );
|
533
537
|
tsp.fixHeight( c );
|
534
538
|
if ( p.initialized && completed !== false ) {
|
535
|
-
if (
|
536
|
-
console.log( 'Pager
|
539
|
+
if ( ts.debug(c, 'pager') ) {
|
540
|
+
console.log( 'Pager >> Triggering pagerComplete' );
|
537
541
|
}
|
538
542
|
c.$table.triggerHandler( 'pagerComplete', c );
|
539
543
|
// save pager info to storage
|
@@ -655,7 +659,6 @@
|
|
655
659
|
hideRows: function( c ) {
|
656
660
|
if ( !c.widgetOptions.pager_ajaxUrl ) {
|
657
661
|
var tbodyIndex, rowIndex, $rows, len, lastIndex,
|
658
|
-
table = c.table,
|
659
662
|
p = c.pager,
|
660
663
|
wo = c.widgetOptions,
|
661
664
|
tbodyLen = c.$tbodies.length,
|
@@ -721,7 +724,8 @@
|
|
721
724
|
renderAjax: function( data, c, xhr, settings, exception ) {
|
722
725
|
var table = c.table,
|
723
726
|
p = c.pager,
|
724
|
-
wo = c.widgetOptions
|
727
|
+
wo = c.widgetOptions,
|
728
|
+
debug = ts.debug(c, 'pager');
|
725
729
|
// process data
|
726
730
|
if ( $.isFunction( wo.pager_ajaxProcessing ) ) {
|
727
731
|
|
@@ -734,15 +738,14 @@
|
|
734
738
|
var i, j, t, hsh, $f, $sh, $headers, $h, icon, th, d, l, rr_count, len, sz,
|
735
739
|
$table = c.$table,
|
736
740
|
tds = '',
|
737
|
-
result = wo.pager_ajaxProcessing( data, table, xhr ) || [ 0, [] ]
|
738
|
-
hl = $table.find( 'thead th' ).length;
|
741
|
+
result = wo.pager_ajaxProcessing( data, table, xhr ) || [ 0, [] ];
|
739
742
|
|
740
743
|
// Clean up any previous error.
|
741
744
|
ts.showError( table );
|
742
745
|
|
743
746
|
if ( exception ) {
|
744
|
-
if (
|
745
|
-
console.error( 'Pager
|
747
|
+
if ( debug ) {
|
748
|
+
console.error( 'Pager >> Ajax Error', xhr, settings, exception );
|
746
749
|
}
|
747
750
|
ts.showError( table, xhr, settings, exception );
|
748
751
|
c.$tbodies.eq( 0 ).children( 'tr' ).detach();
|
@@ -846,8 +849,8 @@
|
|
846
849
|
// apply widgets after table has rendered & after a delay to prevent
|
847
850
|
// multiple applyWidget blocking code from blocking this trigger
|
848
851
|
setTimeout( function() {
|
849
|
-
if (
|
850
|
-
console.log( 'Pager
|
852
|
+
if ( debug ) {
|
853
|
+
console.log( 'Pager >> Triggering pagerChange' );
|
851
854
|
}
|
852
855
|
$table.triggerHandler( 'pagerChange', p );
|
853
856
|
ts.applyWidget( table );
|
@@ -889,8 +892,8 @@
|
|
889
892
|
p.oldAjaxSuccess( data );
|
890
893
|
}
|
891
894
|
};
|
892
|
-
if (
|
893
|
-
console.log( 'Pager
|
895
|
+
if ( ts.debug(c, 'pager') ) {
|
896
|
+
console.log( 'Pager >> Ajax initialized', p.ajaxObject );
|
894
897
|
}
|
895
898
|
$.ajax( p.ajaxObject );
|
896
899
|
}
|
@@ -935,8 +938,8 @@
|
|
935
938
|
if ( $.isFunction( wo.pager_customAjaxUrl ) ) {
|
936
939
|
url = wo.pager_customAjaxUrl( c.table, url );
|
937
940
|
}
|
938
|
-
if (
|
939
|
-
console.log( 'Pager
|
941
|
+
if ( ts.debug(c, 'pager') ) {
|
942
|
+
console.log( 'Pager >> Ajax url = ' + url );
|
940
943
|
}
|
941
944
|
return url;
|
942
945
|
},
|
@@ -946,13 +949,14 @@
|
|
946
949
|
table = c.table,
|
947
950
|
p = c.pager,
|
948
951
|
wo = c.widgetOptions,
|
952
|
+
debug = ts.debug(c, 'pager'),
|
949
953
|
f = c.$table.hasClass('hasFilters'),
|
950
954
|
l = rows && rows.length || 0, // rows may be undefined
|
951
955
|
e = p.size === 'all' ? p.totalRows : p.size,
|
952
956
|
s = ( p.page * e );
|
953
957
|
if ( l < 1 ) {
|
954
|
-
if (
|
955
|
-
console.warn( 'Pager
|
958
|
+
if ( debug ) {
|
959
|
+
console.warn( 'Pager >> No rows for pager to render' );
|
956
960
|
}
|
957
961
|
// empty table, abort!
|
958
962
|
return;
|
@@ -964,8 +968,8 @@
|
|
964
968
|
p.cacheIndex = [];
|
965
969
|
p.isDisabled = false; // needed because sorting will change the page and re-enable the pager
|
966
970
|
if ( p.initialized ) {
|
967
|
-
if (
|
968
|
-
console.log( 'Pager
|
971
|
+
if ( debug ) {
|
972
|
+
console.log( 'Pager >> Triggering pagerChange' );
|
969
973
|
}
|
970
974
|
c.$table.triggerHandler( 'pagerChange', c );
|
971
975
|
}
|
@@ -997,8 +1001,8 @@
|
|
997
1001
|
wo.pager_startPage = p.page;
|
998
1002
|
wo.pager_size = p.size;
|
999
1003
|
if ( table.isUpdating ) {
|
1000
|
-
if (
|
1001
|
-
console.log( 'Pager
|
1004
|
+
if ( debug ) {
|
1005
|
+
console.log( 'Pager >> Triggering updateComplete' );
|
1002
1006
|
}
|
1003
1007
|
c.$table.triggerHandler( 'updateComplete', [ table, true ] );
|
1004
1008
|
}
|
@@ -1016,7 +1020,7 @@
|
|
1016
1020
|
$.data( table, 'pagerLastPage', p.page );
|
1017
1021
|
$.data( table, 'pagerLastSize', p.size );
|
1018
1022
|
p.page = 0;
|
1019
|
-
p.size = p.
|
1023
|
+
p.size = p.totalRows;
|
1020
1024
|
p.totalPages = 1;
|
1021
1025
|
c.$table
|
1022
1026
|
.addClass( 'pagerDisabled' )
|
@@ -1026,8 +1030,8 @@
|
|
1026
1030
|
tsp.renderTable( c, c.rowsCopy );
|
1027
1031
|
p.isDisabled = true;
|
1028
1032
|
ts.applyWidget( table );
|
1029
|
-
if (
|
1030
|
-
console.log( 'Pager
|
1033
|
+
if ( ts.debug(c, 'pager') ) {
|
1034
|
+
console.log( 'Pager >> Disabled' );
|
1031
1035
|
}
|
1032
1036
|
}
|
1033
1037
|
// disable size selector
|
@@ -1074,14 +1078,14 @@
|
|
1074
1078
|
var tmp,
|
1075
1079
|
table = c.table,
|
1076
1080
|
wo = c.widgetOptions,
|
1077
|
-
l = p.last
|
1081
|
+
l = p.last,
|
1082
|
+
debug = ts.debug(c, 'pager');
|
1078
1083
|
|
1079
1084
|
// abort page move if the table has filters and has not been initialized
|
1080
1085
|
if ( p.ajax && !wo.filter_initialized && ts.hasWidget( table, 'filter' ) ) { return; }
|
1081
1086
|
|
1082
1087
|
tsp.parsePageNumber( c, p );
|
1083
1088
|
tsp.calcFilters( c );
|
1084
|
-
|
1085
1089
|
// fixes issue where one current filter is [] and the other is [ '', '', '' ],
|
1086
1090
|
// making the next if comparison think the filters as different. Fixes #202.
|
1087
1091
|
l.currentFilters = ( l.currentFilters || [] ).join( '' ) === '' ? [] : l.currentFilters;
|
@@ -1096,8 +1100,8 @@
|
|
1096
1100
|
l.sortList === ( c.sortList || [] ).join( ',' ) ) {
|
1097
1101
|
return;
|
1098
1102
|
}
|
1099
|
-
if (
|
1100
|
-
console.log( 'Pager
|
1103
|
+
if ( debug ) {
|
1104
|
+
console.log( 'Pager >> Changing to page ' + p.page );
|
1101
1105
|
}
|
1102
1106
|
p.last = {
|
1103
1107
|
page: p.page,
|
@@ -1114,9 +1118,9 @@
|
|
1114
1118
|
wo.pager_processAjaxOnInit = true;
|
1115
1119
|
tmp = wo.pager_initialRows;
|
1116
1120
|
p.totalRows = typeof tmp.total !== 'undefined' ? tmp.total :
|
1117
|
-
(
|
1121
|
+
( debug ? console.error('Pager >> No initial total page set!') || 0 : 0 );
|
1118
1122
|
p.filteredRows = typeof tmp.filtered !== 'undefined' ? tmp.filtered :
|
1119
|
-
(
|
1123
|
+
( debug ? console.error('Pager >> No initial filtered page set!') || 0 : 0 );
|
1120
1124
|
tsp.updatePageDisplay( c, false );
|
1121
1125
|
} else {
|
1122
1126
|
tsp.getAjax( c );
|
@@ -1126,14 +1130,14 @@
|
|
1126
1130
|
}
|
1127
1131
|
$.data( table, 'pagerLastPage', p.page );
|
1128
1132
|
if ( p.initialized && pageMoved !== false ) {
|
1129
|
-
if (
|
1130
|
-
console.log( 'Pager
|
1133
|
+
if ( debug ) {
|
1134
|
+
console.log( 'Pager >> Triggering pageMoved' );
|
1131
1135
|
}
|
1132
1136
|
c.$table.triggerHandler( 'pageMoved', c );
|
1133
1137
|
ts.applyWidget( table );
|
1134
1138
|
if ( !p.ajax && table.isUpdating ) {
|
1135
|
-
if (
|
1136
|
-
console.log( 'Pager
|
1139
|
+
if ( debug ) {
|
1140
|
+
console.log( 'Pager >> Triggering updateComplete' );
|
1137
1141
|
}
|
1138
1142
|
c.$table.triggerHandler( 'updateComplete', [ table, true ] );
|
1139
1143
|
}
|
@@ -1269,8 +1273,8 @@
|
|
1269
1273
|
tsp.setPageSize( c, p.size );
|
1270
1274
|
tsp.moveToPage( c, p, true );
|
1271
1275
|
tsp.hideRowsSetup( c );
|
1272
|
-
if (
|
1273
|
-
console.log( 'Pager
|
1276
|
+
if ( ts.debug(c, 'pager') ) {
|
1277
|
+
console.log( 'Pager >> Enabled' );
|
1274
1278
|
}
|
1275
1279
|
}
|
1276
1280
|
},
|
@@ -1296,8 +1300,7 @@
|
|
1296
1300
|
|
1297
1301
|
// see #486
|
1298
1302
|
ts.showError = function( table, xhr, settings, exception ) {
|
1299
|
-
var $
|
1300
|
-
$table = $( table ),
|
1303
|
+
var $table = $( table ),
|
1301
1304
|
c = $table[ 0 ].config,
|
1302
1305
|
wo = c && c.widgetOptions,
|
1303
1306
|
errorRow = c.pager && c.pager.cssErrorRow ||
|
@@ -1352,9 +1355,10 @@
|
|
1352
1355
|
}
|
1353
1356
|
|
1354
1357
|
// allow message to include entire row HTML!
|
1355
|
-
$
|
1356
|
-
|
1357
|
-
|
1358
|
+
$( /tr\>/.test( message ) ?
|
1359
|
+
message :
|
1360
|
+
'<tr><td colspan="' + c.columns + '">' + message + '</td></tr>'
|
1361
|
+
)
|
1358
1362
|
.click( function() {
|
1359
1363
|
$( this ).remove();
|
1360
1364
|
})
|
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
// Make sure all lazy loaded images are visible - see #1169
|
48
48
|
data = 'data-' + (wo.lazyload_data_attribute || 'original');
|
49
|
-
$table.find('img[' + data + ']').each(function(){
|
49
|
+
$table.find('img[' + data + ']').each(function() {
|
50
50
|
$this = $(this);
|
51
51
|
$this.attr('src', $this.attr(data));
|
52
52
|
});
|