jquery-tablesorter 1.17.2 → 1.17.3
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 +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +76 -71
- data/vendor/assets/javascripts/jquery-tablesorter/extras/jquery.dragtable.mod.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +2647 -2576
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +174 -119
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +2487 -2471
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-extract.js +15 -15
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js +4 -4
- 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 +12 -12
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js +4 -4
- 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 +6 -6
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js +22 -22
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-globalize.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js +15 -15
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-image.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +10 -3
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-named-numbers.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-network.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-roman.js +4 -4
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +122 -121
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +13 -13
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-chart.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +324 -324
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columns.js +60 -60
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js +219 -219
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-html5.js +360 -361
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-jui.js +666 -666
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-select2.js +124 -124
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-type-insideRange.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +1448 -1433
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-formatter.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +213 -213
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-headerTitles.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +271 -216
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +339 -320
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +1057 -1045
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +109 -109
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-reflow.js +114 -115
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +360 -359
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-saveSort.js +59 -59
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +818 -806
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sort2Hash.js +128 -0
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +195 -195
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js +90 -90
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +257 -257
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +76 -76
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-uitheme.js +170 -170
- metadata +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/extras/jquery.quicksearch.js +0 -195
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd33e1b9912661cdb3fc249882a520a008b534bc
|
4
|
+
data.tar.gz: b7b2acce990fd913fd9fc5a491d6df64a50607a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b365dad8398ced78f992742b5e09c593426f4a2be22627371717df678cdae5108f1f280347310b9521f12b63e14aca2ac3752f547616453d905128481cd99060
|
7
|
+
data.tar.gz: abc0adb6ade5c0788cdbb10c0eedede6586b3c12930e32b45c4f28f62b97e68cfd77b9041e9c5ce595ca0d8559da5209dcfa10b5ae87c832d09e1d6bf8a752b2
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Simple integration of jquery-tablesorter into the asset pipeline.
|
6
6
|
|
7
|
-
Current tablesorter version: 2.22.
|
7
|
+
Current tablesorter version: 2.22.4 (7/28/2015), [documentation]
|
8
8
|
|
9
9
|
Any issue associated with the js/css files, please report to [Mottie's fork].
|
10
10
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/*!
|
2
2
|
* tablesorter (FORK) pager plugin
|
3
|
-
* updated
|
3
|
+
* updated 7/28/2015 (v2.22.4)
|
4
4
|
*/
|
5
5
|
/*jshint browser:true, jquery:true, unused:false */
|
6
6
|
;(function($) {
|
7
|
-
|
7
|
+
'use strict';
|
8
8
|
/*jshint supernew:true */
|
9
9
|
var ts = $.tablesorter;
|
10
10
|
|
@@ -159,6 +159,7 @@
|
|
159
159
|
if ( p.initializing ) { return; }
|
160
160
|
var s, t, $out, indx, len, options,
|
161
161
|
c = table.config,
|
162
|
+
namespace = c.namespace + 'pager',
|
162
163
|
sz = p.size || p.settings.size || 10; // don't allow dividing by zero
|
163
164
|
if (p.countChildRows) { t.push(c.cssChildRow); }
|
164
165
|
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
|
@@ -175,13 +176,13 @@
|
|
175
176
|
// form the output string (can now get a new output string from the server)
|
176
177
|
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
|
177
178
|
// {page} = one-based index; {page+#} = zero based index +/- value
|
178
|
-
.replace(/\{page([\-+]\d+)?\}/gi, function(m,n){
|
179
|
+
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){
|
179
180
|
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
|
180
181
|
})
|
181
182
|
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
182
183
|
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
|
183
184
|
var len, indx,
|
184
|
-
str = m.replace(/[{}\s]/g,''),
|
185
|
+
str = m.replace(/[{}\s]/g, ''),
|
185
186
|
extra = str.split(':'),
|
186
187
|
data = p.ajaxData,
|
187
188
|
// return zero for default page/row numbers
|
@@ -206,10 +207,10 @@
|
|
206
207
|
if ($out.length) {
|
207
208
|
$out[ ($out[0].nodeName === 'INPUT') ? 'val' : 'html' ](s);
|
208
209
|
// rebind startRow/page inputs
|
209
|
-
$out.find('.ts-startRow, .ts-page').unbind('change
|
210
|
+
$out.find('.ts-startRow, .ts-page').unbind('change' + namespace).bind('change' + namespace, function(){
|
210
211
|
var v = $(this).val(),
|
211
|
-
pg = $(this).hasClass('ts-startRow') ? Math.floor( v/p.size ) + 1 : v;
|
212
|
-
c.$table.trigger('pageSet
|
212
|
+
pg = $(this).hasClass('ts-startRow') ? Math.floor( v / p.size ) + 1 : v;
|
213
|
+
c.$table.trigger('pageSet' + namespace, [ pg ]);
|
213
214
|
});
|
214
215
|
}
|
215
216
|
}
|
@@ -217,7 +218,7 @@
|
|
217
218
|
fixHeight(table, p);
|
218
219
|
if (p.initialized && completed !== false) {
|
219
220
|
if (c.debug) {
|
220
|
-
|
221
|
+
console.log('Pager: Triggering pagerComplete');
|
221
222
|
}
|
222
223
|
c.$table.trigger('pagerComplete', p);
|
223
224
|
// save pager info to storage
|
@@ -241,7 +242,7 @@
|
|
241
242
|
current_page = p.page + 1,
|
242
243
|
start_page = skip_set_size,
|
243
244
|
end_page = pg - skip_set_size,
|
244
|
-
option_pages = [1],
|
245
|
+
option_pages = [ 1 ],
|
245
246
|
// construct default options pages array
|
246
247
|
option_pages_start_page = (large_collection) ? skip_set_size : 1;
|
247
248
|
|
@@ -285,7 +286,7 @@
|
|
285
286
|
option_pages = $.grep(option_pages, function(value, indx) {
|
286
287
|
return $.inArray(value, option_pages) === indx;
|
287
288
|
})
|
288
|
-
.sort(function(a,b) { return a - b; });
|
289
|
+
.sort(function(a, b) { return a - b; });
|
289
290
|
|
290
291
|
return option_pages;
|
291
292
|
},
|
@@ -367,7 +368,7 @@
|
|
367
368
|
pagerArrows(p);
|
368
369
|
if ( !p.removeRows ) {
|
369
370
|
hideRows(table, p);
|
370
|
-
$(table).bind('sortEnd
|
371
|
+
$(table).bind('sortEnd filterEnd '.split(' ').join(table.config.namespace + 'pager '), function(){
|
371
372
|
hideRows(table, p);
|
372
373
|
});
|
373
374
|
}
|
@@ -375,7 +376,7 @@
|
|
375
376
|
|
376
377
|
renderAjax = function(data, table, p, xhr, exception){
|
377
378
|
// process data
|
378
|
-
if ( typeof
|
379
|
+
if ( typeof p.ajaxProcessing === 'function' ) {
|
379
380
|
// ajaxProcessing result: [ total, rows, headers ]
|
380
381
|
var i, j, t, hsh, $f, $sh, $headers, $h, icon, th, d, l, rr_count, len,
|
381
382
|
c = table.config,
|
@@ -389,7 +390,7 @@
|
|
389
390
|
|
390
391
|
if ( exception ) {
|
391
392
|
if (c.debug) {
|
392
|
-
|
393
|
+
console.error('Pager: >> Ajax Error', xhr, exception);
|
393
394
|
}
|
394
395
|
ts.showError(table,
|
395
396
|
xhr.status === 0 ? 'Not connected, verify Network' :
|
@@ -482,28 +483,28 @@
|
|
482
483
|
p.last.currentFilters = p.currentFilters;
|
483
484
|
p.last.sortList = (c.sortList || []).join(',');
|
484
485
|
updatePageDisplay(table, p, false);
|
485
|
-
$table.trigger('updateCache', [function(){
|
486
|
+
$table.trigger('updateCache', [ function(){
|
486
487
|
if (p.initialized) {
|
487
488
|
// apply widgets after table has rendered & after a delay to prevent
|
488
489
|
// multiple applyWidget blocking code from blocking this trigger
|
489
490
|
setTimeout(function(){
|
490
491
|
if (c.debug) {
|
491
|
-
|
492
|
+
console.log('Pager: Triggering pagerChange');
|
492
493
|
}
|
493
494
|
$table
|
494
495
|
.trigger('applyWidgets')
|
495
496
|
.trigger('pagerChange', p);
|
496
497
|
updatePageDisplay(table, p, true);
|
497
|
-
|
498
|
+
}, 0);
|
498
499
|
}
|
499
|
-
}]);
|
500
|
+
} ]);
|
500
501
|
|
501
502
|
}
|
502
503
|
if (!p.initialized) {
|
503
504
|
p.initialized = true;
|
504
505
|
p.initializing = false;
|
505
506
|
if (table.config.debug) {
|
506
|
-
|
507
|
+
console.log('Pager: Triggering pagerInitialized');
|
507
508
|
}
|
508
509
|
$(table)
|
509
510
|
.trigger('applyWidgets')
|
@@ -512,18 +513,19 @@
|
|
512
513
|
}
|
513
514
|
},
|
514
515
|
|
515
|
-
getAjax = function(table, p){
|
516
|
+
getAjax = function(table, p) {
|
516
517
|
var url = getAjaxUrl(table, p),
|
517
|
-
|
518
|
-
|
519
|
-
|
518
|
+
$doc = $(document),
|
519
|
+
counter,
|
520
|
+
c = table.config,
|
521
|
+
namespace = c.namespace + 'pager';
|
520
522
|
if ( url !== '' ) {
|
521
523
|
if (c.showProcessing) {
|
522
524
|
ts.isProcessing(table, true); // show loading icon
|
523
525
|
}
|
524
|
-
$doc.bind('ajaxError
|
526
|
+
$doc.bind('ajaxError' + namespace, function(e, xhr, settings, exception) {
|
525
527
|
renderAjax(null, table, p, xhr, exception);
|
526
|
-
$doc.unbind('ajaxError
|
528
|
+
$doc.unbind('ajaxError' + namespace);
|
527
529
|
});
|
528
530
|
|
529
531
|
counter = ++p.ajaxCounter;
|
@@ -536,13 +538,13 @@
|
|
536
538
|
return;
|
537
539
|
}
|
538
540
|
renderAjax(data, table, p, jqxhr);
|
539
|
-
$doc.unbind('ajaxError
|
541
|
+
$doc.unbind('ajaxError' + namespace);
|
540
542
|
if (typeof p.oldAjaxSuccess === 'function') {
|
541
543
|
p.oldAjaxSuccess(data);
|
542
544
|
}
|
543
545
|
};
|
544
546
|
if (c.debug) {
|
545
|
-
|
547
|
+
console.log('Pager: Ajax initialized', p.ajaxObject);
|
546
548
|
}
|
547
549
|
$.ajax(p.ajaxObject);
|
548
550
|
}
|
@@ -553,7 +555,7 @@
|
|
553
555
|
c = table.config,
|
554
556
|
url = (p.ajaxUrl) ? p.ajaxUrl
|
555
557
|
// allow using "{page+1}" in the url string to switch to a non-zero based index
|
556
|
-
.replace(/\{page([\-+]\d+)?\}/, function(s,n){ return p.page + (n ? parseInt(n, 10) : 0); })
|
558
|
+
.replace(/\{page([\-+]\d+)?\}/, function(s, n){ return p.page + (n ? parseInt(n, 10) : 0); })
|
557
559
|
.replace(/\{size\}/g, p.size) : '',
|
558
560
|
sortList = c.sortList,
|
559
561
|
filterList = p.currentFilters || $(table).data('lastSearch') || [],
|
@@ -582,11 +584,11 @@
|
|
582
584
|
url = url.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join('&') : filterCol );
|
583
585
|
p.currentFilters = filterList;
|
584
586
|
}
|
585
|
-
if ( typeof
|
587
|
+
if ( typeof p.customAjaxUrl === 'function' ) {
|
586
588
|
url = p.customAjaxUrl(table, url);
|
587
589
|
}
|
588
590
|
if (c.debug) {
|
589
|
-
|
591
|
+
console.log('Pager: Ajax url = ' + url);
|
590
592
|
}
|
591
593
|
return url;
|
592
594
|
},
|
@@ -601,7 +603,7 @@
|
|
601
603
|
e = p.size;
|
602
604
|
if ( l < 1 ) {
|
603
605
|
if (c.debug) {
|
604
|
-
|
606
|
+
console.warn('Pager: >> No rows for pager to render');
|
605
607
|
}
|
606
608
|
// empty table, abort!
|
607
609
|
return;
|
@@ -614,7 +616,7 @@
|
|
614
616
|
p.isDisabled = false; // needed because sorting will change the page and re-enable the pager
|
615
617
|
if (p.initialized) {
|
616
618
|
if (c.debug) {
|
617
|
-
|
619
|
+
console.log('Pager: Triggering pagerChange');
|
618
620
|
}
|
619
621
|
$t.trigger('pagerChange', p);
|
620
622
|
}
|
@@ -645,13 +647,13 @@
|
|
645
647
|
updatePageDisplay(table, p);
|
646
648
|
if (table.isUpdating) {
|
647
649
|
if (c.debug) {
|
648
|
-
|
650
|
+
console.log('Pager: Triggering updateComplete');
|
649
651
|
}
|
650
652
|
$t.trigger('updateComplete', [ table, true ]);
|
651
653
|
}
|
652
654
|
},
|
653
655
|
|
654
|
-
showAllRows = function(table, p){
|
656
|
+
showAllRows = function(table, p) {
|
655
657
|
var index, $controls, len;
|
656
658
|
if ( p.ajax ) {
|
657
659
|
pagerArrows(p, true);
|
@@ -669,7 +671,7 @@
|
|
669
671
|
renderTable(table, table.config.rowsCopy, p);
|
670
672
|
$(table).trigger('applyWidgets');
|
671
673
|
if (table.config.debug) {
|
672
|
-
|
674
|
+
console.log('Pager: Disabled');
|
673
675
|
}
|
674
676
|
}
|
675
677
|
// disable size selector
|
@@ -728,7 +730,7 @@
|
|
728
730
|
(l.optAjaxUrl || '') === (p.ajaxUrl || '') &&
|
729
731
|
l.sortList === (c.sortList || []).join(',') ) { return; }
|
730
732
|
if (c.debug) {
|
731
|
-
|
733
|
+
console.log('Pager: Changing to page ' + p.page);
|
732
734
|
}
|
733
735
|
p.last = {
|
734
736
|
page : p.page,
|
@@ -748,14 +750,14 @@
|
|
748
750
|
$.data(table, 'pagerLastPage', p.page);
|
749
751
|
if (p.initialized && pageMoved !== false) {
|
750
752
|
if (c.debug) {
|
751
|
-
|
753
|
+
console.log('Pager: Triggering pageMoved');
|
752
754
|
}
|
753
755
|
$t
|
754
756
|
.trigger('pageMoved', p)
|
755
757
|
.trigger('applyWidgets');
|
756
758
|
if (table.isUpdating) {
|
757
759
|
if (c.debug) {
|
758
|
-
|
760
|
+
console.log('Pager: Triggering updateComplete');
|
759
761
|
}
|
760
762
|
$t.trigger('updateComplete', [ table, true ]);
|
761
763
|
}
|
@@ -798,19 +800,20 @@
|
|
798
800
|
moveToPage(table, p);
|
799
801
|
},
|
800
802
|
|
801
|
-
destroyPager = function(table, p){
|
803
|
+
destroyPager = function(table, p) {
|
802
804
|
showAllRows(table, p);
|
803
805
|
p.$container.hide(); // hide pager
|
804
|
-
table.config
|
806
|
+
var c = table.config;
|
807
|
+
c.appender = null; // remove pager appender function
|
805
808
|
p.initialized = false;
|
806
|
-
delete
|
807
|
-
$(table).unbind( pagerEvents.split(' ').join('
|
809
|
+
delete c.rowsCopy;
|
810
|
+
$(table).unbind( pagerEvents.split(' ').join(c.namespace + 'pager ').replace(/\s+/g, ' ') );
|
808
811
|
if (ts.storage) {
|
809
812
|
ts.storage(table, p.storageKey, '');
|
810
813
|
}
|
811
814
|
},
|
812
815
|
|
813
|
-
enablePager = function(table, p, triggered){
|
816
|
+
enablePager = function(table, p, triggered) {
|
814
817
|
var info,
|
815
818
|
c = table.config;
|
816
819
|
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
@@ -834,7 +837,7 @@
|
|
834
837
|
setPageSize(table, p.size, p);
|
835
838
|
hideRowsSetup(table, p);
|
836
839
|
if (c.debug) {
|
837
|
-
|
840
|
+
console.log('Pager: Enabled');
|
838
841
|
}
|
839
842
|
}
|
840
843
|
};
|
@@ -863,12 +866,13 @@
|
|
863
866
|
wo = c.widgetOptions,
|
864
867
|
p = c.pager = $.extend( true, {}, $.tablesorterPager.defaults, settings ),
|
865
868
|
$t = c.$table,
|
869
|
+
namespace = c.namespace + 'pager',
|
866
870
|
// added in case the pager is reinitialized after being destroyed.
|
867
871
|
pager = p.$container = $(p.container).addClass('tablesorter-pager').show();
|
868
872
|
// save a copy of the original settings
|
869
873
|
p.settings = $.extend( true, {}, $.tablesorterPager.defaults, settings );
|
870
874
|
if (c.debug) {
|
871
|
-
|
875
|
+
console.log('Pager: Initializing');
|
872
876
|
}
|
873
877
|
p.oldAjaxSuccess = p.oldAjaxSuccess || p.ajaxObject.success;
|
874
878
|
c.appender = $this.appender;
|
@@ -884,8 +888,8 @@
|
|
884
888
|
p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.slice(1) + '|' + c.cssChildRow + ')');
|
885
889
|
|
886
890
|
$t
|
887
|
-
.unbind( pagerEvents.split(' ').join('
|
888
|
-
.bind('filterInit
|
891
|
+
.unbind( pagerEvents.split(' ').join(namespace + ' ').replace(/\s+/g, ' ') )
|
892
|
+
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
|
889
893
|
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
|
890
894
|
// don't change page if filters are the same (pager updating, etc)
|
891
895
|
if (e.type === 'filterStart' && p.pageReset !== false && (c.lastCombinedFilter || '') !== (p.currentFilters || []).join('')) {
|
@@ -893,7 +897,7 @@
|
|
893
897
|
}
|
894
898
|
})
|
895
899
|
// update pager after filter widget completes
|
896
|
-
.bind('filterEnd
|
900
|
+
.bind('filterEnd sortEnd '.split(' ').join(namespace + ' '), function() {
|
897
901
|
p.currentFilters = c.$table.data('lastSearch');
|
898
902
|
if (p.initialized || p.initializing) {
|
899
903
|
if (c.delayInit && c.rowsCopy && c.rowsCopy.length === 0) {
|
@@ -905,19 +909,19 @@
|
|
905
909
|
c.$table.trigger('applyWidgets');
|
906
910
|
}
|
907
911
|
})
|
908
|
-
.bind('disable
|
912
|
+
.bind('disable' + namespace, function(e){
|
909
913
|
e.stopPropagation();
|
910
914
|
showAllRows(table, p);
|
911
915
|
})
|
912
|
-
.bind('enable
|
916
|
+
.bind('enable' + namespace, function(e){
|
913
917
|
e.stopPropagation();
|
914
918
|
enablePager(table, p, true);
|
915
919
|
})
|
916
|
-
.bind('destroy
|
920
|
+
.bind('destroy' + namespace, function(e){
|
917
921
|
e.stopPropagation();
|
918
922
|
destroyPager(table, p);
|
919
923
|
})
|
920
|
-
.bind('updateComplete
|
924
|
+
.bind('updateComplete' + namespace, function(e, table, triggered){
|
921
925
|
e.stopPropagation();
|
922
926
|
// table can be unintentionally undefined in tablesorter v2.17.7 and earlier
|
923
927
|
// don't recalculate total rows/pages if using ajax
|
@@ -936,13 +940,13 @@
|
|
936
940
|
changeHeight(table, p);
|
937
941
|
updatePageDisplay(table, p, true);
|
938
942
|
})
|
939
|
-
.bind('pageSize
|
943
|
+
.bind('pageSize refreshComplete '.split(' ').join(namespace + ' '), function(e, v){
|
940
944
|
e.stopPropagation();
|
941
945
|
setPageSize(table, parseInt(v, 10) || p.settings.size || 10, p);
|
942
946
|
hideRows(table, p);
|
943
947
|
updatePageDisplay(table, p, false);
|
944
948
|
})
|
945
|
-
.bind('pageSet
|
949
|
+
.bind('pageSet pagerUpdate '.split(' ').join(namespace + ' '), function(e, v){
|
946
950
|
e.stopPropagation();
|
947
951
|
// force pager refresh
|
948
952
|
if (e.type === 'pagerUpdate') {
|
@@ -953,7 +957,7 @@
|
|
953
957
|
moveToPage(table, p, true);
|
954
958
|
updatePageDisplay(table, p, false);
|
955
959
|
})
|
956
|
-
.bind('pageAndSize
|
960
|
+
.bind('pageAndSize' + namespace, function(e, page, size){
|
957
961
|
e.stopPropagation();
|
958
962
|
p.page = (parseInt(page, 10) || 1) - 1;
|
959
963
|
setPageSize(table, parseInt(size, 10) || p.settings.size || 10, p);
|
@@ -966,12 +970,12 @@
|
|
966
970
|
ctrls = [ p.cssFirst, p.cssPrev, p.cssNext, p.cssLast ];
|
967
971
|
fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ];
|
968
972
|
if (c.debug && !pager.length) {
|
969
|
-
|
973
|
+
console.warn('Pager: >> Container not found');
|
970
974
|
}
|
971
975
|
pager.find(ctrls.join(','))
|
972
|
-
.attr(
|
973
|
-
.unbind('click
|
974
|
-
.bind('click
|
976
|
+
.attr('tabindex', 0)
|
977
|
+
.unbind('click' + namespace)
|
978
|
+
.bind('click' + namespace, function(e){
|
975
979
|
e.stopPropagation();
|
976
980
|
var i, $t = $(this), l = ctrls.length;
|
977
981
|
if ( !$t.hasClass(p.cssDisabled) ) {
|
@@ -988,21 +992,21 @@
|
|
988
992
|
p.$goto = pager.find(p.cssGoto);
|
989
993
|
if ( p.$goto.length ) {
|
990
994
|
p.$goto
|
991
|
-
.unbind('change
|
992
|
-
.bind('change
|
995
|
+
.unbind('change' + namespace)
|
996
|
+
.bind('change' + namespace, function(){
|
993
997
|
p.page = $(this).val() - 1;
|
994
998
|
moveToPage(table, p, true);
|
995
999
|
updatePageDisplay(table, p, false);
|
996
1000
|
});
|
997
1001
|
} else if (c.debug) {
|
998
|
-
|
1002
|
+
console.warn('Pager: >> Goto selector not found');
|
999
1003
|
}
|
1000
1004
|
// page size selector
|
1001
1005
|
p.$size = pager.find(p.cssPageSize);
|
1002
1006
|
if ( p.$size.length ) {
|
1003
1007
|
// setting an option as selected appears to cause issues with initial page size
|
1004
1008
|
p.$size.find('option').removeAttr('selected');
|
1005
|
-
p.$size.unbind('change
|
1009
|
+
p.$size.unbind('change' + namespace).bind('change' + namespace, function() {
|
1006
1010
|
p.$size.val( $(this).val() ); // in case there are more than one pagers
|
1007
1011
|
if ( !$(this).hasClass(p.cssDisabled) ) {
|
1008
1012
|
setPageSize(table, parseInt( $(this).val(), 10 ), p);
|
@@ -1011,7 +1015,7 @@
|
|
1011
1015
|
return false;
|
1012
1016
|
});
|
1013
1017
|
} else if (c.debug) {
|
1014
|
-
|
1018
|
+
console.warn('Pager: >> Size selector not found');
|
1015
1019
|
}
|
1016
1020
|
|
1017
1021
|
// clear initialized flag
|
@@ -1020,17 +1024,18 @@
|
|
1020
1024
|
$t.trigger('pagerBeforeInitialized', p);
|
1021
1025
|
|
1022
1026
|
enablePager(table, p, false);
|
1023
|
-
if ( typeof
|
1027
|
+
if ( typeof p.ajaxUrl === 'string' ) {
|
1024
1028
|
// ajax pager; interact with database
|
1025
1029
|
p.ajax = true;
|
1026
|
-
//When filtering with ajax, allow only custom filtering function, disable default
|
1030
|
+
// When filtering with ajax, allow only custom filtering function, disable default
|
1031
|
+
// filtering since it will be done server side.
|
1027
1032
|
c.widgetOptions.filter_serversideFiltering = true;
|
1028
1033
|
c.serverSideSorting = true;
|
1029
1034
|
moveToPage(table, p);
|
1030
1035
|
} else {
|
1031
1036
|
p.ajax = false;
|
1032
1037
|
// Regular pager; all rows stored in memory
|
1033
|
-
$(this).trigger(
|
1038
|
+
$(this).trigger('appendCache', true);
|
1034
1039
|
hideRowsSetup(table, p);
|
1035
1040
|
}
|
1036
1041
|
|
@@ -1040,7 +1045,7 @@
|
|
1040
1045
|
p.initialized = true;
|
1041
1046
|
moveToPage(table, p);
|
1042
1047
|
if (c.debug) {
|
1043
|
-
|
1048
|
+
console.log('Pager: Triggering pagerInitialized');
|
1044
1049
|
}
|
1045
1050
|
c.$table.trigger('pagerInitialized', p);
|
1046
1051
|
if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) {
|
@@ -1083,9 +1088,9 @@
|
|
1083
1088
|
}
|
1084
1089
|
};
|
1085
1090
|
|
1086
|
-
// extend plugin scope
|
1087
|
-
$.fn.extend({
|
1088
|
-
|
1089
|
-
});
|
1091
|
+
// extend plugin scope
|
1092
|
+
$.fn.extend({
|
1093
|
+
tablesorterPager: $.tablesorterPager.construct
|
1094
|
+
});
|
1090
1095
|
|
1091
1096
|
})(jQuery);
|