jquery-tablesorter 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/jquery-tablesorter/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +293 -258
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +176 -123
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js +26 -21
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +53 -53
- data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap.css +8 -16
- metadata +43 -42
data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Filter widget formatter functions - updated
|
1
|
+
/*! Filter widget formatter functions - updated 10/10/2013
|
2
2
|
* requires: tableSorter 2.7.7+ and jQuery 1.4.3+
|
3
3
|
*
|
4
4
|
* uiSpinner (jQuery UI spinner)
|
@@ -488,7 +488,7 @@ $.tablesorter.filterFormatter = {
|
|
488
488
|
changeYear : true,
|
489
489
|
numberOfMonths : 1
|
490
490
|
}, defDate),
|
491
|
-
t, closeFrom, $shcell = [],
|
491
|
+
t, closeTo, closeFrom, $shcell = [],
|
492
492
|
// Add a hidden input to hold the range values
|
493
493
|
$input = $('<input class="dateRange" type="hidden">')
|
494
494
|
.appendTo($cell)
|
@@ -502,7 +502,7 @@ $.tablesorter.filterFormatter = {
|
|
502
502
|
} else if (v.match('>=')) {
|
503
503
|
closeFrom( v.replace('>=', '') );
|
504
504
|
} else if (v.match('<=')) {
|
505
|
-
|
505
|
+
closeTo( v.replace('<=', '') );
|
506
506
|
}
|
507
507
|
}),
|
508
508
|
c = $cell.closest('table')[0].config;
|
@@ -516,18 +516,18 @@ $.tablesorter.filterFormatter = {
|
|
516
516
|
// add callbacks; preserve added callbacks
|
517
517
|
o.oldonClose = o.onClose;
|
518
518
|
|
519
|
-
o.defaultDate = o.from || o.defaultDate;
|
519
|
+
var localfrom = o.defaultDate = o.from || o.defaultDate;
|
520
520
|
|
521
521
|
closeFrom = o.onClose = function( selectedDate, ui ) {
|
522
|
-
var from = new Date(
|
523
|
-
to = new Date($cell.find('.dateTo').datepicker('getDate')).getTime() || '',
|
522
|
+
var from = new Date( selectedDate ).getTime() || '',
|
523
|
+
to = new Date( $cell.find('.dateTo').datepicker('getDate') ).getTime() || '',
|
524
524
|
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
525
525
|
$cell
|
526
|
-
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
527
|
-
.find('.dateFrom').val(selectedDate).end()
|
528
|
-
// update hidden input
|
529
526
|
.find('.dateRange').val(range)
|
530
|
-
.trigger('search')
|
527
|
+
.trigger('search').end()
|
528
|
+
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
529
|
+
.find('.dateFrom').val(selectedDate);
|
530
|
+
|
531
531
|
// update sticky header cell
|
532
532
|
if ($shcell.length) {
|
533
533
|
$shcell
|
@@ -538,16 +538,18 @@ $.tablesorter.filterFormatter = {
|
|
538
538
|
};
|
539
539
|
|
540
540
|
$cell.find('.dateFrom').datepicker(o);
|
541
|
+
|
541
542
|
o.defaultDate = o.to || '+7d'; // set to date +7 days from today (if not defined)
|
542
|
-
o.onClose = function( selectedDate, ui ) {
|
543
|
+
closeTo = o.onClose = function( selectedDate, ui ) {
|
543
544
|
var from = new Date( $cell.find('.dateFrom').datepicker('getDate') ).getTime() || '',
|
544
|
-
to = new Date(
|
545
|
+
to = new Date( selectedDate ).getTime() || '',
|
545
546
|
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
546
547
|
$cell
|
547
|
-
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
548
|
-
.find('.dateTo').val(selectedDate).end()
|
549
548
|
.find('.dateRange').val(range)
|
550
|
-
.trigger('search')
|
549
|
+
.trigger('search').end()
|
550
|
+
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
551
|
+
.find('.dateTo').val(selectedDate);
|
552
|
+
|
551
553
|
// update sticky header cell
|
552
554
|
if ($shcell.length) {
|
553
555
|
$shcell
|
@@ -561,24 +563,27 @@ $.tablesorter.filterFormatter = {
|
|
561
563
|
// has sticky headers?
|
562
564
|
c.$table.bind('stickyHeadersInit', function(){
|
563
565
|
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
566
|
+
$shcell.append(t);
|
567
|
+
|
564
568
|
// add a jQuery datepicker!
|
565
|
-
|
566
|
-
|
569
|
+
o.onClose = closeTo;
|
570
|
+
$shcell.find('.dateTo').datepicker(o);
|
571
|
+
|
572
|
+
o.defaultDate = localfrom;
|
567
573
|
o.onClose = closeFrom;
|
568
574
|
$shcell.find('.dateFrom').datepicker(o);
|
569
575
|
});
|
570
576
|
|
571
577
|
// on reset
|
572
578
|
$cell.closest('table').bind('filterReset', function(){
|
573
|
-
$cell.find('.dateFrom, .dateTo').val('');
|
579
|
+
$cell.find('.dateFrom, .dateTo').val('').datepicker('option', 'currentText', '' );
|
574
580
|
if ($shcell.length) {
|
575
|
-
$shcell.find('.dateFrom, .dateTo').val('');
|
581
|
+
$shcell.find('.dateFrom, .dateTo').val('').datepicker('option', 'currentText', '' );
|
576
582
|
}
|
577
583
|
});
|
578
584
|
|
579
585
|
// return the hidden input so the filter widget has a reference to it
|
580
|
-
|
581
|
-
return $input.val( t );
|
586
|
+
return $input.val( o.from ? ( o.to ? o.from + ' - ' + o.to : '>=' + o.from ) : (o.to ? '<=' + o.to : '') );
|
582
587
|
},
|
583
588
|
|
584
589
|
/**********************\
|
@@ -22,8 +22,8 @@ ts.themes = {
|
|
22
22
|
footerCells: '',
|
23
23
|
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
|
24
24
|
sortNone : 'bootstrap-icon-unsorted',
|
25
|
-
sortAsc : 'icon-chevron-up',
|
26
|
-
sortDesc : 'icon-chevron-down',
|
25
|
+
sortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up',
|
26
|
+
sortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down',
|
27
27
|
active : '', // applied when column is sorted
|
28
28
|
hover : '', // use custom css here - bootstrap class may not override it
|
29
29
|
filterRow : '', // filter row class
|
@@ -88,7 +88,7 @@ ts.storage = function(table, key, val){
|
|
88
88
|
v = (d !== 0) ? $.parseJSON(k[d] || '{}') : {};
|
89
89
|
}
|
90
90
|
}
|
91
|
-
// allow val to be an empty string to
|
91
|
+
// allow val to be an empty string to
|
92
92
|
if ((val || val === '') && window.JSON && JSON.hasOwnProperty('stringify')){
|
93
93
|
// add unique identifiers = url pathname > table ID/index on page > data
|
94
94
|
if (!v[url]) {
|
@@ -195,7 +195,7 @@ ts.addWidget({
|
|
195
195
|
}
|
196
196
|
if (c.cssIcon){
|
197
197
|
// if c.cssIcon is '', then no <i> is added to the header
|
198
|
-
$h.find('.' +
|
198
|
+
$h.find('.' + ts.css.icon).addClass(o.icons);
|
199
199
|
}
|
200
200
|
if ($t.hasClass('hasFilters')){
|
201
201
|
$h.find('.tablesorter-filter-row').addClass(o.filterRow);
|
@@ -203,14 +203,14 @@ ts.addWidget({
|
|
203
203
|
}
|
204
204
|
$.each($h, function(i){
|
205
205
|
$el = $(this);
|
206
|
-
$tar = (
|
206
|
+
$tar = (ts.css.icon) ? $el.find('.' + ts.css.icon) : $el;
|
207
207
|
if (this.sortDisabled){
|
208
208
|
// no sort arrows for disabled columns!
|
209
209
|
$el.removeClass(rmv);
|
210
210
|
$tar.removeClass(rmv + ' tablesorter-icon ' + o.icons);
|
211
211
|
} else {
|
212
212
|
t = ($t.hasClass('hasStickyHeaders')) ? $t.find(sh).find('th').eq(i).add($el) : $el;
|
213
|
-
klass = ($el.hasClass(
|
213
|
+
klass = ($el.hasClass(ts.css.sortAsc)) ? o.sortAsc : ($el.hasClass(ts.css.sortDesc)) ? o.sortDesc : $el.hasClass(ts.css.header) ? o.sortNone : '';
|
214
214
|
$el[klass === o.sortNone ? 'removeClass' : 'addClass'](o.active);
|
215
215
|
$tar.removeClass(rmv).addClass(klass);
|
216
216
|
}
|
@@ -227,7 +227,7 @@ ts.addWidget({
|
|
227
227
|
rmv = o.sortNone + ' ' + o.sortDesc + ' ' + o.sortAsc;
|
228
228
|
$t
|
229
229
|
.removeClass('tablesorter-' + theme + ' ' + o.table)
|
230
|
-
.find(
|
230
|
+
.find(ts.css.header).removeClass(o.header);
|
231
231
|
$h
|
232
232
|
.unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover
|
233
233
|
.removeClass(o.hover + ' ' + rmv + ' ' + o.active)
|
@@ -287,20 +287,16 @@ ts.addWidget({
|
|
287
287
|
ts.processTbody(table, $tb, false);
|
288
288
|
}
|
289
289
|
// add classes to thead and tfoot
|
290
|
-
$tr = wo.columns_thead !== false ? 'thead tr' :
|
290
|
+
$tr = wo.columns_thead !== false ? ['thead tr'] : [];
|
291
291
|
if (wo.columns_tfoot !== false) {
|
292
|
-
$tr
|
292
|
+
$tr.push('tfoot tr');
|
293
293
|
}
|
294
294
|
if ($tr.length) {
|
295
|
-
$t = $tbl.find($tr).children().removeClass(rmv);
|
296
|
-
if (
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
for (i = 1; i < len; i++){
|
301
|
-
// secondary, tertiary, etc sort column classes
|
302
|
-
$t.filter('[data-column="' + list[i][0] + '"]').addClass(css[i] || css[last]);
|
303
|
-
}
|
295
|
+
$t = $tbl.find($tr.join(',')).children().removeClass(rmv);
|
296
|
+
if (len){
|
297
|
+
for (i = 0; i < len; i++){
|
298
|
+
// add primary. secondary, tertiary, etc sort column classes
|
299
|
+
$t.filter('[data-column="' + list[i][0] + '"]').addClass(css[i] || css[last]);
|
304
300
|
}
|
305
301
|
}
|
306
302
|
}
|
@@ -332,7 +328,7 @@ ts.addWidget({
|
|
332
328
|
options : {
|
333
329
|
filter_childRows : false, // if true, filter includes child row content in the search
|
334
330
|
filter_columnFilters : true, // if true, a filter will be added to the top of each table column
|
335
|
-
filter_cssFilter : '
|
331
|
+
filter_cssFilter : '', // css class name added to the filter row & each input in the row (tablesorter-filter is ALWAYS added)
|
336
332
|
filter_filteredRow : 'filtered', // class added to filtered rows; needed by pager plugin
|
337
333
|
filter_formatter : null, // add custom filter elements to the filter row
|
338
334
|
filter_functions : null, // add custom filter functions using this option
|
@@ -353,7 +349,7 @@ ts.addWidget({
|
|
353
349
|
"child" : /tablesorter-childRow/, // child row class name; this gets updated in the script
|
354
350
|
"filtered" : /filtered/, // filtered (hidden) row class name; updated in the script
|
355
351
|
"type" : /undefined|number/, // check type
|
356
|
-
"exact" : /(^[\"|\'|=])|([\"|\'|=]
|
352
|
+
"exact" : /(^[\"|\'|=]+)|([\"|\'|=]+$)/g, // exact match (allow '==')
|
357
353
|
"nondigit" : /[^\w,. \-()]/g, // replace non-digits (from digit & currency parser)
|
358
354
|
"operators" : /[<>=]/g // replace operators
|
359
355
|
}
|
@@ -365,9 +361,8 @@ ts.addWidget({
|
|
365
361
|
fmt = ts.formatFloat,
|
366
362
|
last = '', // save last filter search
|
367
363
|
$ths = c.$headers,
|
368
|
-
css = wo.filter_cssFilter,
|
369
364
|
$t = c.$table.addClass('hasFilters'),
|
370
|
-
b =
|
365
|
+
b = c.$tbodies,
|
371
366
|
cols = c.parsers.length,
|
372
367
|
parsed, time, timer,
|
373
368
|
|
@@ -403,7 +398,7 @@ ts.addWidget({
|
|
403
398
|
var $tb, $tr, $td, cr, r, l, ff, time, r1, r2, searchFiltered;
|
404
399
|
if (c.debug) { time = new Date(); }
|
405
400
|
for (k = 0; k < b.length; k++ ){
|
406
|
-
if (b.eq(k).hasClass(
|
401
|
+
if (b.eq(k).hasClass(ts.css.info)) { continue; } // ignore info blocks, issue #264
|
407
402
|
$tb = ts.processTbody(table, b.eq(k), true);
|
408
403
|
$tr = $tb.children('tr:not(.' + c.cssChildRow + ')');
|
409
404
|
l = $tr.length;
|
@@ -444,6 +439,8 @@ ts.addWidget({
|
|
444
439
|
}
|
445
440
|
xi = !wo.filter_regex.type.test(typeof x) && wo.filter_ignoreCase ? x.toLocaleLowerCase() : x;
|
446
441
|
ff = r; // if r is true, show that row
|
442
|
+
// replace accents - see #357
|
443
|
+
v[i] = c.sortLocaleCompare ? ts.replaceAccents(v[i]) : v[i];
|
447
444
|
// val = case insensitive, v[i] = case sensitive
|
448
445
|
val = wo.filter_ignoreCase ? v[i].toLocaleLowerCase() : v[i];
|
449
446
|
if (wo.filter_functions && wo.filter_functions[i]){
|
@@ -452,10 +449,10 @@ ts.addWidget({
|
|
452
449
|
ff = ($ths.filter('[data-column="' + i + '"]:last').hasClass('filter-match')) ? xi.search(val) >= 0 : v[i] === x;
|
453
450
|
} else if (typeof wo.filter_functions[i] === 'function'){
|
454
451
|
// filter callback( exact cell content, parser normalized content, filter input value, column index )
|
455
|
-
ff = wo.filter_functions[i](x, c.cache[k].normalized[j][i], v[i], i);
|
452
|
+
ff = wo.filter_functions[i](x, c.cache[k].normalized[j][i], v[i], i, $tr.eq(j));
|
456
453
|
} else if (typeof wo.filter_functions[i][v[i]] === 'function'){
|
457
454
|
// selector option function
|
458
|
-
ff = wo.filter_functions[i][v[i]](x, c.cache[k].normalized[j][i], v[i], i);
|
455
|
+
ff = wo.filter_functions[i][v[i]](x, c.cache[k].normalized[j][i], v[i], i, $tr.eq(j));
|
459
456
|
}
|
460
457
|
// Look for regex
|
461
458
|
} else if (wo.filter_regex.regex.test(val)){
|
@@ -578,7 +575,7 @@ ts.addWidget({
|
|
578
575
|
arry = (ts.sortText) ? arry.sort(function(a, b){ return ts.sortText(table, a, b, i); }) : arry.sort(true);
|
579
576
|
|
580
577
|
// Get curent filter value
|
581
|
-
currentVal = $t.find('thead').find('select.
|
578
|
+
currentVal = $t.find('thead').find('select.tablesorter-filter[data-column="' + i + '"]').val();
|
582
579
|
|
583
580
|
// build option list
|
584
581
|
for (k = 0; k < arry.length; k++){
|
@@ -586,7 +583,7 @@ ts.addWidget({
|
|
586
583
|
// replace quotes - fixes #242 & ignore empty strings - see http://stackoverflow.com/q/14990971/145346
|
587
584
|
o += arry[k] !== '' ? '<option value="' + t + '"' + (currentVal === t ? ' selected="selected"' : '') +'>' + arry[k] + '</option>' : '';
|
588
585
|
}
|
589
|
-
$t.find('thead').find('select.
|
586
|
+
$t.find('thead').find('select.tablesorter-filter[data-column="' + i + '"]')[ updating ? 'html' : 'append' ](o);
|
590
587
|
},
|
591
588
|
buildDefault = function(updating){
|
592
589
|
// build default select dropdown
|
@@ -605,7 +602,7 @@ ts.addWidget({
|
|
605
602
|
// delay filtering
|
606
603
|
clearTimeout(timer);
|
607
604
|
timer = setTimeout(function(){
|
608
|
-
checkFilters(filter);
|
605
|
+
checkFilters(filter);
|
609
606
|
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10);
|
610
607
|
} else {
|
611
608
|
// skip delay
|
@@ -658,7 +655,7 @@ ts.addWidget({
|
|
658
655
|
}
|
659
656
|
}
|
660
657
|
if (t) {
|
661
|
-
t.addClass(
|
658
|
+
t.addClass('tablesorter-filter ' + wo.filter_cssFilter).attr('data-column', i);
|
662
659
|
if (dis) {
|
663
660
|
t.addClass('disabled')[0].disabled = true; // disabled!
|
664
661
|
}
|
@@ -672,7 +669,7 @@ ts.addWidget({
|
|
672
669
|
buildDefault(true);
|
673
670
|
}
|
674
671
|
if (e.type === 'filterReset') {
|
675
|
-
|
672
|
+
searching([]);
|
676
673
|
}
|
677
674
|
if (e.type === 'filterEnd') {
|
678
675
|
buildDefault(true);
|
@@ -683,7 +680,7 @@ ts.addWidget({
|
|
683
680
|
}
|
684
681
|
return false;
|
685
682
|
})
|
686
|
-
.find('input.'
|
683
|
+
.find('input.tablesorter-filter').bind('keyup search', function(e, filter){
|
687
684
|
// emulate what webkit does.... escape clears the filter
|
688
685
|
if (e.which === 27) {
|
689
686
|
this.value = '';
|
@@ -701,8 +698,8 @@ ts.addWidget({
|
|
701
698
|
}).get();
|
702
699
|
|
703
700
|
// reset button/link
|
704
|
-
if (wo.filter_reset
|
705
|
-
$(wo.filter_reset
|
701
|
+
if (wo.filter_reset){
|
702
|
+
$(document).delegate(wo.filter_reset, 'click.tsfilter', function(){
|
706
703
|
$t.trigger('filterReset');
|
707
704
|
});
|
708
705
|
}
|
@@ -722,7 +719,7 @@ ts.addWidget({
|
|
722
719
|
ff += '<option value="' + str + '">' + str + '</option>';
|
723
720
|
}
|
724
721
|
}
|
725
|
-
$t.find('thead').find('select.
|
722
|
+
$t.find('thead').find('select.tablesorter-filter[data-column="' + col + '"]').append(ff);
|
726
723
|
}
|
727
724
|
}
|
728
725
|
}
|
@@ -731,7 +728,7 @@ ts.addWidget({
|
|
731
728
|
// it would append the same options twice.
|
732
729
|
buildDefault(true);
|
733
730
|
|
734
|
-
$t.find('select.'
|
731
|
+
$t.find('select.tablesorter-filter').bind('change search', function(e, filter){
|
735
732
|
checkFilters(filter);
|
736
733
|
});
|
737
734
|
|
@@ -752,8 +749,8 @@ ts.addWidget({
|
|
752
749
|
// $(':focus') needs jQuery 1.6+
|
753
750
|
if ($(document.activeElement).closest('tr')[0] !== ft[0]){
|
754
751
|
// get all filter values
|
755
|
-
all = $t.find('.'
|
756
|
-
return $(this).val() || '';
|
752
|
+
all = $t.find('.tablesorter-filter').map(function(){
|
753
|
+
return $(this).val() || '';
|
757
754
|
}).get().join('');
|
758
755
|
// don't hide row if any filter has a value
|
759
756
|
if (all === ''){
|
@@ -768,7 +765,7 @@ ts.addWidget({
|
|
768
765
|
clearTimeout(st);
|
769
766
|
st = setTimeout(function(){
|
770
767
|
// don't hide row if any filter has a value
|
771
|
-
if ($t.find('.'
|
768
|
+
if ($t.find('.tablesorter-filter').map(function(){ return $(this).val() || ''; }).get().join('') === ''){
|
772
769
|
ft2[ e.type === 'focus' ? 'removeClass' : 'addClass']('hideme');
|
773
770
|
}
|
774
771
|
}, 200);
|
@@ -778,7 +775,7 @@ ts.addWidget({
|
|
778
775
|
// show processing icon
|
779
776
|
if (c.showProcessing) {
|
780
777
|
$t.bind('filterStart.tsfilter filterEnd.tsfilter', function(e, v) {
|
781
|
-
var fc = (v) ? $t.find('.' +
|
778
|
+
var fc = (v) ? $t.find('.' + ts.css.header).filter('[data-column]').filter(function(){
|
782
779
|
return v[$(this).data('column')] !== '';
|
783
780
|
}) : '';
|
784
781
|
ts.isProcessing($t[0], e.type === 'filterStart', v ? fc : '');
|
@@ -791,10 +788,13 @@ ts.addWidget({
|
|
791
788
|
// add default values
|
792
789
|
$t.bind('tablesorter-initialized', function(){
|
793
790
|
ff = ts.getFilters(table);
|
794
|
-
|
795
|
-
|
791
|
+
// ff is undefined when filter_columnFilters = false
|
792
|
+
if (ff) {
|
793
|
+
for (i = 0; i < ff.length; i++) {
|
794
|
+
ff[i] = $ths.filter('[data-column="' + i + '"]:last').attr(wo.filter_defaultAttrib) || ff[i];
|
795
|
+
}
|
796
|
+
ts.setFilters(table, ff, true);
|
796
797
|
}
|
797
|
-
ts.setFilters(table, ff, true);
|
798
798
|
});
|
799
799
|
// filter widget initialized
|
800
800
|
$t.trigger('filterInit');
|
@@ -815,20 +815,20 @@ ts.addWidget({
|
|
815
815
|
$tb.children().removeClass(wo.filter_filteredRow).show();
|
816
816
|
ts.processTbody(table, $tb, false); // restore tbody
|
817
817
|
}
|
818
|
-
if (wo.filterreset) { $(wo.filter_reset
|
818
|
+
if (wo.filterreset) { $(document).undelegate(wo.filter_reset, 'click.tsfilter'); }
|
819
819
|
}
|
820
820
|
});
|
821
821
|
ts.getFilters = function(table) {
|
822
822
|
var c = table ? $(table)[0].config : {};
|
823
823
|
if (c && c.widgetOptions && !c.widgetOptions.filter_columnFilters) { return $(table).data('lastSearch'); }
|
824
|
-
return c && c.$filters ? c.$filters.find('.'
|
824
|
+
return c && c.$filters ? c.$filters.find('.tablesorter-filter').map(function(i, el) {
|
825
825
|
return $(el).val();
|
826
826
|
}).get() || [] : false;
|
827
827
|
};
|
828
828
|
ts.setFilters = function(table, filter, apply) {
|
829
829
|
var $t = $(table),
|
830
830
|
c = $t.length ? $t[0].config : {},
|
831
|
-
valid = c && c.$filters ? c.$filters.find('.'
|
831
|
+
valid = c && c.$filters ? c.$filters.find('.tablesorter-filter').each(function(i, el) {
|
832
832
|
$(el).val(filter[i] || '');
|
833
833
|
}).trigger('change.tsfilter') || false : false;
|
834
834
|
if (apply) { $t.trigger('search', [filter, false]); }
|
@@ -837,14 +837,14 @@ ts.setFilters = function(table, filter, apply) {
|
|
837
837
|
|
838
838
|
// Widget: Sticky headers
|
839
839
|
// based on this awesome article:
|
840
|
-
// http://css-tricks.com/13465-persistent-headers/
|
840
|
+
// http://css-tricks.com/13465-persistent-headers/
|
841
841
|
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
|
842
842
|
// **************************
|
843
843
|
ts.addWidget({
|
844
844
|
id: "stickyHeaders",
|
845
845
|
priority: 60,
|
846
846
|
options: {
|
847
|
-
stickyHeaders : '
|
847
|
+
stickyHeaders : '', // extra class name added to the sticky header row
|
848
848
|
stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
|
849
849
|
stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists
|
850
850
|
stickyHeaders_addResizeEvent : true, // trigger "resize" event on headers
|
@@ -859,7 +859,7 @@ ts.addWidget({
|
|
859
859
|
hdrCells = header.children('tr:not(.sticky-false)').children(),
|
860
860
|
innr = '.tablesorter-header-inner',
|
861
861
|
tfoot = $t.find('tfoot'),
|
862
|
-
filterInputs = '.
|
862
|
+
filterInputs = '.tablesorter-filter',
|
863
863
|
$stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '',
|
864
864
|
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
|
865
865
|
stickyzIndex = wo.stickyHeaders_zIndex ? wo.stickyHeaders_zIndex : 2,
|
@@ -872,7 +872,7 @@ ts.addWidget({
|
|
872
872
|
visibility : 'hidden',
|
873
873
|
zIndex : stickyzIndex
|
874
874
|
}),
|
875
|
-
stkyHdr = $stickyTable.children('thead:first').addClass(wo.stickyHeaders),
|
875
|
+
stkyHdr = $stickyTable.children('thead:first').addClass('tablesorter-stickyHeader ' + wo.stickyHeaders),
|
876
876
|
stkyCells,
|
877
877
|
laststate = '',
|
878
878
|
spacing = 0,
|
@@ -924,11 +924,11 @@ ts.addWidget({
|
|
924
924
|
t
|
925
925
|
.attr('class', $(this).attr('class'))
|
926
926
|
// remove processing icon
|
927
|
-
.removeClass(c.cssProcessing);
|
927
|
+
.removeClass(ts.css.processing + ' ' + c.cssProcessing);
|
928
928
|
if (c.cssIcon){
|
929
929
|
t
|
930
|
-
.find('.' +
|
931
|
-
.attr('class', $(this).find('.' +
|
930
|
+
.find('.' + ts.css.icon)
|
931
|
+
.attr('class', $(this).find('.' + ts.css.icon).attr('class'));
|
932
932
|
}
|
933
933
|
});
|
934
934
|
})
|
@@ -1008,7 +1008,7 @@ ts.addWidget({
|
|
1008
1008
|
c.$table
|
1009
1009
|
.removeClass('hasStickyHeaders')
|
1010
1010
|
.unbind('sortEnd.tsSticky pagerComplete.tsSticky')
|
1011
|
-
.find('.'
|
1011
|
+
.find('.tablesorter-stickyHeader').remove();
|
1012
1012
|
if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
|
1013
1013
|
// don't unbind if any table on the page still has stickyheaders applied
|
1014
1014
|
if (!$('.hasStickyHeaders').length) {
|
@@ -9,22 +9,9 @@
|
|
9
9
|
.tablesorter-bootstrap tfoot th,
|
10
10
|
.tablesorter-bootstrap tfoot td {
|
11
11
|
font: bold 14px/20px Arial, Sans-serif;
|
12
|
-
|
13
|
-
padding: 8px;
|
12
|
+
padding: 4px;
|
14
13
|
margin: 0 0 18px;
|
15
|
-
|
16
|
-
background-color: #FBFBFB;
|
17
|
-
background-image: -moz-linear-gradient(top, white, #efefef);
|
18
|
-
background-image: -ms-linear-gradient(top, white, #efefef);
|
19
|
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#efefef));
|
20
|
-
background-image: -webkit-linear-gradient(top, white, #efefef);
|
21
|
-
background-image: -o-linear-gradient(top, white, #efefef);
|
22
|
-
background-image: linear-gradient(to bottom, white, #efefef);
|
23
|
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#efefef', GradientType=0);
|
24
|
-
background-repeat: repeat-x;
|
25
|
-
-webkit-box-shadow: inset 0 1px 0 white;
|
26
|
-
-moz-box-shadow: inset 0 1px 0 #ffffff;
|
27
|
-
box-shadow: inset 0 1px 0 white;
|
14
|
+
background-color: #eee;
|
28
15
|
}
|
29
16
|
|
30
17
|
.tablesorter-bootstrap .tablesorter-header {
|
@@ -38,6 +25,7 @@
|
|
38
25
|
|
39
26
|
/* bootstrap uses <i> for icons */
|
40
27
|
.tablesorter-bootstrap .tablesorter-header i {
|
28
|
+
font-size: 11px;
|
41
29
|
position: absolute;
|
42
30
|
right: 2px;
|
43
31
|
top: 50%;
|
@@ -97,7 +85,7 @@ caption {
|
|
97
85
|
cursor: not-allowed;
|
98
86
|
}
|
99
87
|
.tablesorter-bootstrap .tablesorter-filter-row td {
|
100
|
-
background: #
|
88
|
+
background: #efefef;
|
101
89
|
line-height: normal;
|
102
90
|
text-align: center;
|
103
91
|
padding: 4px 6px;
|
@@ -131,6 +119,10 @@ caption {
|
|
131
119
|
.tablesorter-bootstrap .tablesorter-pager .pagedisplay {
|
132
120
|
border: 0;
|
133
121
|
}
|
122
|
+
/* tfoot i for pager controls */
|
123
|
+
.tablesorter-bootstrap tfoot i {
|
124
|
+
font-size: 11px;
|
125
|
+
}
|
134
126
|
|
135
127
|
/* ajax error row */
|
136
128
|
.tablesorter .tablesorter-errorRow td {
|