jquery-tablesorter 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jquery-tablesorter/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +25 -20
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js +15 -15
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +28 -29
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +10 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +3 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +2 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d639b535865896da6a17f2df96f4e9f91955d3c
|
4
|
+
data.tar.gz: 65db0875623d6c2dd8d394ca82f4b8a1ddbb6900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 607932c25ac349c0a182932789532f7967f7587a7a5bbac50321c8cf9da397f26dc22d2cf5dc4891a2d3daf4b5a40759da1e3af1fa743f20b86c142fd69808f4
|
7
|
+
data.tar.gz: bafbde9cfdda3b9e8f9f086c2004f1f7310bf52aeaf9896d6c5cd2f3f6e0481f85bb11059e3e3729cc3e01593f3c6b3d00f0f5de3e25fa1e02d4263f6fb401bf
|
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.16.
|
7
|
+
Current tablesorter version: 2.16.2 (4/27/2014), [documentation]
|
8
8
|
|
9
9
|
Any issue associate with the js/css files, please report to [Mottie's fork].
|
10
10
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**!
|
2
|
-
* TableSorter 2.16.
|
2
|
+
* TableSorter 2.16.2 - Client-side table sorting with ease!
|
3
3
|
* @requires jQuery v1.2.6+
|
4
4
|
*
|
5
5
|
* Copyright (c) 2007 Christian Bach
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
var ts = this;
|
26
26
|
|
27
|
-
ts.version = "2.16.
|
27
|
+
ts.version = "2.16.2";
|
28
28
|
|
29
29
|
ts.parsers = [];
|
30
30
|
ts.widgets = [];
|
@@ -489,34 +489,34 @@
|
|
489
489
|
}
|
490
490
|
|
491
491
|
function setHeadersCss(table) {
|
492
|
-
var f, i, j,
|
492
|
+
var f, i, j,
|
493
493
|
c = table.config,
|
494
494
|
list = c.sortList,
|
495
|
+
len = list.length,
|
495
496
|
none = ts.css.sortNone + ' ' + c.cssNone,
|
496
497
|
css = [ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc],
|
497
498
|
aria = ['ascending', 'descending'],
|
498
499
|
// find the footer
|
499
|
-
$t = $(table).find('tfoot tr').children().removeClass(css.join(' '));
|
500
|
+
$t = $(table).find('tfoot tr').children().add(c.$extraHeaders).removeClass(css.join(' '));
|
500
501
|
// remove all header information
|
501
502
|
c.$headers
|
502
503
|
.removeClass(css.join(' '))
|
503
504
|
.addClass(none).attr('aria-sort', 'none');
|
504
|
-
|
505
|
-
for (i = 0; i < l; i++) {
|
505
|
+
for (i = 0; i < len; i++) {
|
506
506
|
// direction = 2 means reset!
|
507
507
|
if (list[i][1] !== 2) {
|
508
508
|
// multicolumn sorting updating - choose the :last in case there are nested columns
|
509
|
-
f = c.$headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (
|
509
|
+
f = c.$headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (len === 1 ? ':last' : '') );
|
510
510
|
if (f.length) {
|
511
511
|
for (j = 0; j < f.length; j++) {
|
512
512
|
if (!f[j].sortDisabled) {
|
513
513
|
f.eq(j).removeClass(none).addClass(css[list[i][1]]).attr('aria-sort', aria[list[i][1]]);
|
514
|
-
// add sorted class to footer, if it exists
|
515
|
-
if ($t.length) {
|
516
|
-
$t.filter('[data-column="' + list[i][0] + '"]').eq(j).addClass(css[list[i][1]]);
|
517
|
-
}
|
518
514
|
}
|
519
515
|
}
|
516
|
+
// add sorted class to footer & extra headers, if they exist
|
517
|
+
if ($t.length) {
|
518
|
+
$t.filter('[data-column="' + list[i][0] + '"]').removeClass(none).addClass(css[list[i][1]]);
|
519
|
+
}
|
520
520
|
}
|
521
521
|
}
|
522
522
|
}
|
@@ -544,7 +544,7 @@
|
|
544
544
|
}
|
545
545
|
}
|
546
546
|
|
547
|
-
function updateHeaderSortCount(table, list) {
|
547
|
+
function updateHeaderSortCount(table, list, triggered) {
|
548
548
|
var s, t, o, c = table.config,
|
549
549
|
sl = list || c.sortList;
|
550
550
|
c.sortList = [];
|
@@ -552,10 +552,11 @@
|
|
552
552
|
// ensure all sortList values are numeric - fixes #127
|
553
553
|
s = [ parseInt(v[0], 10), parseInt(v[1], 10) ];
|
554
554
|
// make sure header exists
|
555
|
-
o = c.$headers[s[0]];
|
555
|
+
o = c.$headers.filter('[data-column="' + s[0] + '"]:last')[0];
|
556
556
|
if (o) { // prevents error if sorton array is wrong
|
557
557
|
c.sortList.push(s);
|
558
558
|
t = $.inArray(s[1], o.order); // fixes issue #167
|
559
|
+
if (triggered) { o.count = o.count + 1; }
|
559
560
|
o.count = t >= 0 ? t : s[1] % (c.sortReset ? 3 : 2);
|
560
561
|
}
|
561
562
|
});
|
@@ -625,7 +626,7 @@
|
|
625
626
|
// reverse the sorting direction
|
626
627
|
for (col = 0; col < c.sortList.length; col++) {
|
627
628
|
s = c.sortList[col];
|
628
|
-
order = c.$headers[s[0]];
|
629
|
+
order = c.$headers.filter('[data-column="' + s[0] + '"]:last')[0];
|
629
630
|
if (s[0] === indx) {
|
630
631
|
// order.count seems to be incorrect when compared to cell.count
|
631
632
|
s[1] = order.order[cell.count];
|
@@ -782,7 +783,7 @@
|
|
782
783
|
ts.refreshWidgets(table, true, true);
|
783
784
|
ts.restoreHeaders(table);
|
784
785
|
buildHeaders(table);
|
785
|
-
ts.bindEvents(table, c.$headers);
|
786
|
+
ts.bindEvents(table, c.$headers, true);
|
786
787
|
bindMethods(table);
|
787
788
|
commonUpdate(table, resort, callback);
|
788
789
|
})
|
@@ -827,6 +828,7 @@
|
|
827
828
|
updateHeader(table);
|
828
829
|
commonUpdate(table, resort, callback);
|
829
830
|
} else {
|
831
|
+
$row = $($row); // make sure we're using a jQuery object
|
830
832
|
var i, j, l, rowData, cells,
|
831
833
|
rows = $row.filter('tr').length,
|
832
834
|
tbdy = $table.find('tbody').index( $row.parents('tbody').filter(':first') );
|
@@ -868,7 +870,7 @@
|
|
868
870
|
e.stopPropagation();
|
869
871
|
$table.trigger("sortStart", this);
|
870
872
|
// update header count index
|
871
|
-
updateHeaderSortCount(table, list);
|
873
|
+
updateHeaderSortCount(table, list, true);
|
872
874
|
// set css for headers
|
873
875
|
setHeadersCss(table);
|
874
876
|
// fixes #346
|
@@ -961,7 +963,7 @@
|
|
961
963
|
return (version[0] > 1) || (version[0] === 1 && parseInt(version[1], 10) >= 4);
|
962
964
|
})($.fn.jquery.split("."));
|
963
965
|
// digit sort text location; keeping max+/- for backwards compatibility
|
964
|
-
c.string = { 'max': 1, 'min': -1, '
|
966
|
+
c.string = { 'max': 1, 'min': -1, 'emptyMin': 1, 'emptyMax': -1, 'zero': 0, 'none': 0, 'null': 0, 'top': true, 'bottom': false };
|
965
967
|
// add table theme class only if there isn't already one there
|
966
968
|
if (!/tablesorter\-/.test($table.attr('class'))) {
|
967
969
|
k = (c.theme !== '' ? ' tablesorter-' + c.theme : '');
|
@@ -999,7 +1001,7 @@
|
|
999
1001
|
// delayInit will delay building the cache until the user starts a sort
|
1000
1002
|
if (!c.delayInit) { buildCache(table); }
|
1001
1003
|
// bind all header events and methods
|
1002
|
-
ts.bindEvents(table, c.$headers);
|
1004
|
+
ts.bindEvents(table, c.$headers, true);
|
1003
1005
|
bindMethods(table);
|
1004
1006
|
// get sort list from jQuery data or metadata
|
1005
1007
|
// in jQuery < 1.4, an error occurs when calling $table.data()
|
@@ -1132,10 +1134,13 @@
|
|
1132
1134
|
$(table)[0].config.$tbodies.empty();
|
1133
1135
|
};
|
1134
1136
|
|
1135
|
-
ts.bindEvents = function(table, $headers){
|
1137
|
+
ts.bindEvents = function(table, $headers, core){
|
1136
1138
|
table = $(table)[0];
|
1137
1139
|
var downTime,
|
1138
|
-
|
1140
|
+
c = table.config;
|
1141
|
+
if (core !== true) {
|
1142
|
+
c.$extraHeaders = c.$extraHeaders ? c.$extraHeaders.add($headers) : $headers;
|
1143
|
+
}
|
1139
1144
|
// apply event handling to headers and/or additional headers (stickyheaders, scroller, etc)
|
1140
1145
|
$headers
|
1141
1146
|
// http://stackoverflow.com/questions/5312849/jquery-find-self;
|
data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Filter widget formatter functions - updated 4/
|
1
|
+
/*! Filter widget formatter functions - updated 4/27/2014 (v2.16.2)
|
2
2
|
* requires: tableSorter 2.15+ and jQuery 1.4.3+
|
3
3
|
*
|
4
4
|
* uiSpinner (jQuery UI spinner)
|
@@ -517,7 +517,7 @@ tsff = ts.filterFormatter = {
|
|
517
517
|
getdate = $date.datepicker('getDate') || '',
|
518
518
|
compare = ($.isArray(o.compare) ? $cell.find(compareSelect).val() || o.compare[ o.selected || 0] : o.compare) || '',
|
519
519
|
searchType = c.$table[0].hasInitialized ? o.delayed || '': true;
|
520
|
-
$date.datepicker('setDate', getdate === '' ? '' : getdate);
|
520
|
+
$date.datepicker('setDate', (getdate === '' ? '' : getdate) || null);
|
521
521
|
if (getdate === '') { notrigger = false; }
|
522
522
|
date = $date.datepicker('getDate');
|
523
523
|
query = date ? ( o.endOfDay && /<=/.test(compare) ? date.setHours(23, 59, 59) : date.getTime() ) || '' : '';
|
@@ -557,7 +557,7 @@ tsff = ts.filterFormatter = {
|
|
557
557
|
if ($.isArray(o.compare)) {
|
558
558
|
$cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
|
559
559
|
}
|
560
|
-
$cell.add($shcell).find('.date').val(o.defaultDate).datepicker('setDate', o.defaultDate);
|
560
|
+
$cell.add($shcell).find('.date').val(o.defaultDate).datepicker('setDate', o.defaultDate || null);
|
561
561
|
setTimeout(function(){
|
562
562
|
date1Compare();
|
563
563
|
}, 0);
|
@@ -570,13 +570,13 @@ tsff = ts.filterFormatter = {
|
|
570
570
|
// date range found; assume an exact match on one day
|
571
571
|
$cell.find(compareSelect).val('=');
|
572
572
|
num = v.split(/\s+-\s+/)[0];
|
573
|
-
$date.datepicker( 'setDate', num );
|
573
|
+
$date.datepicker( 'setDate', num || null );
|
574
574
|
} else {
|
575
575
|
num = (tsff.updateCompare($cell, $input, o)[1]).toString() || '';
|
576
576
|
// differeniate 1388556000000 from 1/1/2014 using \d{5} regex
|
577
577
|
num = num !== '' ? /\d{5}/g.test(num) ? Number(num) : num || '' : '';
|
578
578
|
}
|
579
|
-
$cell.add($shcell).find('.date').datepicker( 'setDate', num );
|
579
|
+
$cell.add($shcell).find('.date').datepicker( 'setDate', num || null );
|
580
580
|
setTimeout(function(){
|
581
581
|
date1Compare(true);
|
582
582
|
}, 0);
|
@@ -681,16 +681,16 @@ tsff = ts.filterFormatter = {
|
|
681
681
|
|
682
682
|
if (/<=/.test(range)) {
|
683
683
|
$cell.add( $shcell )
|
684
|
-
.find('.dateFrom').datepicker('option', 'maxDate', to ).end()
|
685
|
-
.find('.dateTo').datepicker('option', 'minDate', null).datepicker('setDate', to);
|
684
|
+
.find('.dateFrom').datepicker('option', 'maxDate', to || null ).end()
|
685
|
+
.find('.dateTo').datepicker('option', 'minDate', null).datepicker('setDate', to || null);
|
686
686
|
} else if (/>=/.test(range)) {
|
687
687
|
$cell.add( $shcell )
|
688
|
-
.find('.dateFrom').datepicker('option', 'maxDate', null).datepicker('setDate', from).end()
|
689
|
-
.find('.dateTo').datepicker('option', 'minDate', from );
|
688
|
+
.find('.dateFrom').datepicker('option', 'maxDate', null).datepicker('setDate', from || null).end()
|
689
|
+
.find('.dateTo').datepicker('option', 'minDate', from || null );
|
690
690
|
} else {
|
691
691
|
$cell.add( $shcell )
|
692
|
-
.find('.dateFrom').datepicker('option', 'maxDate', null).datepicker('setDate', from ).end()
|
693
|
-
.find('.dateTo').datepicker('option', 'minDate', null).datepicker('setDate', to);
|
692
|
+
.find('.dateFrom').datepicker('option', 'maxDate', null).datepicker('setDate', from || null ).end()
|
693
|
+
.find('.dateTo').datepicker('option', 'minDate', null).datepicker('setDate', to || null);
|
694
694
|
}
|
695
695
|
|
696
696
|
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
@@ -718,8 +718,8 @@ tsff = ts.filterFormatter = {
|
|
718
718
|
// less than date (from date empty)
|
719
719
|
to = val.replace(/<=/, '') || '';
|
720
720
|
}
|
721
|
-
$cell.add($shcell).find('.dateFrom').datepicker('setDate', from);
|
722
|
-
$cell.add($shcell).find('.dateTo').datepicker('setDate', to);
|
721
|
+
$cell.add($shcell).find('.dateFrom').datepicker('setDate', from || null);
|
722
|
+
$cell.add($shcell).find('.dateTo').datepicker('setDate', to || null);
|
723
723
|
// give datepicker time to process
|
724
724
|
setTimeout(function(){
|
725
725
|
closeDate();
|
@@ -742,8 +742,8 @@ tsff = ts.filterFormatter = {
|
|
742
742
|
|
743
743
|
// on reset
|
744
744
|
$cell.closest('table').bind('filterReset', function(){
|
745
|
-
$cell.add($shcell).find('.dateFrom').val('').datepicker('setDate', o.from );
|
746
|
-
$cell.add($shcell).find('.dateTo').val('').datepicker('setDate', o.to );
|
745
|
+
$cell.add($shcell).find('.dateFrom').val('').datepicker('setDate', o.from || null );
|
746
|
+
$cell.add($shcell).find('.dateTo').val('').datepicker('setDate', o.to || null );
|
747
747
|
setTimeout(function(){
|
748
748
|
closeDate();
|
749
749
|
}, 0);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! tableSorter 2.16+ widgets - updated 4/
|
1
|
+
/*! tableSorter 2.16+ widgets - updated 4/27/2014 (v2.16.2)
|
2
2
|
*
|
3
3
|
* Column Styles
|
4
4
|
* Column Filters
|
@@ -176,7 +176,7 @@ ts.addWidget({
|
|
176
176
|
id: "uitheme",
|
177
177
|
priority: 10,
|
178
178
|
format: function(table, c, wo) {
|
179
|
-
var time, classes, $header, $icon, $tfoot,
|
179
|
+
var i, time, classes, $header, $icon, $tfoot,
|
180
180
|
themesAll = ts.themes,
|
181
181
|
$table = c.$table,
|
182
182
|
$headers = c.$headers,
|
@@ -222,10 +222,10 @@ ts.addWidget({
|
|
222
222
|
$headers.find('.' + ts.css.filterRow).addClass(themes.filterRow);
|
223
223
|
}
|
224
224
|
}
|
225
|
-
|
226
|
-
$header =
|
225
|
+
for (i = 0; i < c.columns; i++) {
|
226
|
+
$header = c.$headers.add(c.$extraHeaders).filter('[data-column="' + i + '"]');
|
227
227
|
$icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $header;
|
228
|
-
if (
|
228
|
+
if (c.$headers.filter('[data-column="' + i + '"]:last')[0].sortDisabled) {
|
229
229
|
// no sort arrows for disabled columns!
|
230
230
|
$header.removeClass(remove);
|
231
231
|
$icon.removeClass(remove + ' ' + themes.icons);
|
@@ -237,7 +237,7 @@ ts.addWidget({
|
|
237
237
|
$header[classes === themes.sortNone ? 'removeClass' : 'addClass'](themes.active);
|
238
238
|
$icon.removeClass(remove).addClass(classes);
|
239
239
|
}
|
240
|
-
}
|
240
|
+
}
|
241
241
|
if (c.debug) {
|
242
242
|
ts.benchmark("Applying " + theme + " theme", time);
|
243
243
|
}
|
@@ -856,7 +856,7 @@ ts.filter = {
|
|
856
856
|
if (table.config.lastCombinedFilter === combinedFilters) { return; }
|
857
857
|
var cached, len, $rows, cacheIndex, rowIndex, tbodyIndex, $tbody, $cells, columnIndex,
|
858
858
|
childRow, childRowText, exact, iExact, iFilter, lastSearch, matches, result,
|
859
|
-
searchFiltered, filterMatched, showRow, time,
|
859
|
+
notFiltered, searchFiltered, filterMatched, showRow, time,
|
860
860
|
anyMatch, iAnyMatch, rowArray, rowText, iRowText, rowCache,
|
861
861
|
c = table.config,
|
862
862
|
wo = c.widgetOptions,
|
@@ -887,11 +887,23 @@ ts.filter = {
|
|
887
887
|
searchFiltered = true;
|
888
888
|
lastSearch = c.lastSearch || c.$table.data('lastSearch') || [];
|
889
889
|
$.each(filters, function(indx, val) {
|
890
|
-
//
|
891
|
-
searchFiltered =
|
890
|
+
// search already filtered rows if...
|
891
|
+
searchFiltered = searchFiltered &&
|
892
|
+
// there are changes from beginning of filter
|
893
|
+
(val || '').indexOf(lastSearch[indx]) === 0 &&
|
894
|
+
// if there is not a logical "or" in the string
|
895
|
+
!/(\s+or\s+|\|)/g.test(val || '') &&
|
896
|
+
// if we are not doing exact matches
|
897
|
+
!/[=\"]/.test(lastSearch[indx]) &&
|
898
|
+
// if filtering using a select without a "filter-match" class (exact match) - fixes #593
|
899
|
+
!( val !== '' && wo.filter_functions && wo.filter_functions[indx] === true && !c.$headers.filter('[data-column="' + indx + '"]:last').hasClass('filter-match') );
|
892
900
|
});
|
901
|
+
notFiltered = $rows.not('.' + wo.filter_filteredRow).length;
|
893
902
|
// can't search when all rows are hidden - this happens when looking for exact matches
|
894
|
-
if (searchFiltered &&
|
903
|
+
if (searchFiltered && notFiltered === 0) { searchFiltered = false; }
|
904
|
+
if (c.debug) {
|
905
|
+
ts.log( "Searching through " + ( searchFiltered && notFiltered < len ? notFiltered : "all" ) + " rows" );
|
906
|
+
}
|
895
907
|
if ((wo.filter_$anyMatch && wo.filter_$anyMatch.length) || filters[c.columns]) {
|
896
908
|
anyMatch = wo.filter_$anyMatch && wo.filter_$anyMatch.val() || filters[c.columns] || '';
|
897
909
|
if (c.sortLocaleCompare) {
|
@@ -1213,6 +1225,7 @@ ts.addWidget({
|
|
1213
1225
|
stickyHeaders : '', // extra class name added to the sticky header row
|
1214
1226
|
stickyHeaders_attachTo : null, // jQuery selector or object to attach sticky header to
|
1215
1227
|
stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
|
1228
|
+
stickyHeaders_filteredToTop: true, // scroll table top into view after filtering
|
1216
1229
|
stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists
|
1217
1230
|
stickyHeaders_addResizeEvent : true, // trigger "resize" event on headers
|
1218
1231
|
stickyHeaders_includeCaption : true, // if false and a caption exist, it won't be included in the sticky header
|
@@ -1223,8 +1236,7 @@ ts.addWidget({
|
|
1223
1236
|
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
|
1224
1237
|
return;
|
1225
1238
|
}
|
1226
|
-
var $
|
1227
|
-
$table = c.$table,
|
1239
|
+
var $table = c.$table,
|
1228
1240
|
$attach = $(wo.stickyHeaders_attachTo),
|
1229
1241
|
$thead = $table.children('thead:first'),
|
1230
1242
|
$win = $attach.length ? $attach : $(window),
|
@@ -1296,19 +1308,6 @@ ts.addWidget({
|
|
1296
1308
|
// update sticky header class names to match real header after sorting
|
1297
1309
|
$table
|
1298
1310
|
.addClass('hasStickyHeaders')
|
1299
|
-
.bind('sortEnd.tsSticky', function() {
|
1300
|
-
$header.filter(':visible').each(function(indx) {
|
1301
|
-
$cell = $stickyCells.filter(':visible').eq(indx)
|
1302
|
-
.attr('class', $(this).attr('class'))
|
1303
|
-
// remove processing icon
|
1304
|
-
.removeClass(ts.css.processing + ' ' + c.cssProcessing);
|
1305
|
-
if (c.cssIcon) {
|
1306
|
-
$cell
|
1307
|
-
.find('.' + ts.css.icon)
|
1308
|
-
.attr('class', $(this).find('.' + ts.css.icon).attr('class'));
|
1309
|
-
}
|
1310
|
-
});
|
1311
|
-
})
|
1312
1311
|
.bind('pagerComplete.tsSticky', function() {
|
1313
1312
|
resizeHeader();
|
1314
1313
|
});
|
@@ -1355,11 +1354,11 @@ ts.addWidget({
|
|
1355
1354
|
var $td = $(document.activeElement).closest('td'),
|
1356
1355
|
column = $td.parent().children().index($td);
|
1357
1356
|
// only scroll if sticky header is active
|
1358
|
-
if ($stickyTable.hasClass(ts.css.stickyVis)) {
|
1357
|
+
if ($stickyTable.hasClass(ts.css.stickyVis) && wo.stickyHeaders_filteredToTop) {
|
1359
1358
|
// scroll to original table (not sticky clone)
|
1360
1359
|
window.scrollTo(0, $table.position().top);
|
1361
|
-
// give same input/select focus
|
1362
|
-
if (column >= 0) {
|
1360
|
+
// give same input/select focus; check if c.$filters exists; fixes #594
|
1361
|
+
if (column >= 0 && c.$filters) {
|
1363
1362
|
c.$filters.eq(column).find('a, select, input').filter(':visible').focus();
|
1364
1363
|
}
|
1365
1364
|
}
|
@@ -1373,7 +1372,7 @@ ts.addWidget({
|
|
1373
1372
|
remove: function(table, c, wo) {
|
1374
1373
|
c.$table
|
1375
1374
|
.removeClass('hasStickyHeaders')
|
1376
|
-
.unbind('
|
1375
|
+
.unbind('pagerComplete.tsSticky')
|
1377
1376
|
.find('.' + ts.css.sticky).remove();
|
1378
1377
|
if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
|
1379
1378
|
// don't unbind if any table on the page still has stickyheaders applied
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*! input & select parsers for jQuery 1.7+ & tablesorter 2.7.11+
|
2
|
-
* Updated
|
2
|
+
* Updated 4/27/2014 (v2.16.2)
|
3
3
|
* Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
|
4
4
|
*/
|
5
5
|
/*jshint browser: true, jquery:true, unused:false */
|
@@ -75,7 +75,15 @@
|
|
75
75
|
$('table').find('tbody').on('change', 'select, input', function(e){
|
76
76
|
if (!alreadyUpdating) {
|
77
77
|
var $tar = $(e.target),
|
78
|
-
$
|
78
|
+
$cell = $tar.closest('td'),
|
79
|
+
$table = $cell.closest('table'),
|
80
|
+
indx = $cell[0].cellIndex,
|
81
|
+
c = $table[0].config,
|
82
|
+
$hdr = c && c.$headers && c.$headers.eq(indx);
|
83
|
+
// don't use updateCell if column is set to "sorter-false" and "filter-false"
|
84
|
+
if ($hdr.length && $hdr.hasClass('sorter-false') && $hdr.hasClass('filter-false')){
|
85
|
+
return false;
|
86
|
+
}
|
79
87
|
alreadyUpdating = true;
|
80
88
|
$table.trigger('updateCell', [ $tar.closest('td'), resort ]);
|
81
89
|
updateServer(e, $table, $tar);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! tablesorter math widget - beta
|
1
|
+
/*! tablesorter math widget - beta - updated 4/27/2014 (v2.16.2)
|
2
2
|
* Requires tablesorter v2.16+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -149,7 +149,8 @@
|
|
149
149
|
},
|
150
150
|
|
151
151
|
output : function($cell, wo, value, arry) {
|
152
|
-
|
152
|
+
// get mask from cell data-attribute: data-math-mask="#,##0.00"
|
153
|
+
var result = ts.formatMask( $cell.attr('data-' + wo.math_data + '-mask') || wo.math_mask, value );
|
153
154
|
if ($.isFunction(wo.math_complete)) {
|
154
155
|
result = wo.math_complete($cell, wo, result, value, arry);
|
155
156
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
Resizable scroller widget for the jQuery tablesorter plugin
|
12
12
|
|
13
|
-
Version 2.0 - modified by Rob Garrison (4/12/2013; updated 4/
|
13
|
+
Version 2.0 - modified by Rob Garrison (4/12/2013; updated 4/27/2014 for tablesorter v2.16.2)
|
14
14
|
Requires jQuery v1.7+
|
15
15
|
Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
|
16
16
|
|
@@ -109,23 +109,7 @@ ts.addWidget({
|
|
109
109
|
.wrap('<div class="tablesorter-scroller-header" style="width:' + $tbl.width() + ';" />')
|
110
110
|
.find('.' + ts.css.header);
|
111
111
|
|
112
|
-
$tbl
|
113
|
-
.wrap('<div class="tablesorter-scroller-table" style="height:' + h + 'px;width:' + $tbl.width() + ';overflow-y:scroll;" />')
|
114
|
-
.unbind('sortEnd.tsScroller')
|
115
|
-
.bind('sortEnd.tsScroller', function(){
|
116
|
-
c.$headers.each(function(i){
|
117
|
-
var t = $cells.eq(i);
|
118
|
-
t
|
119
|
-
.attr('class', $(this).attr('class'))
|
120
|
-
// remove processing icon
|
121
|
-
.removeClass(ts.css.processing + ' ' + c.cssProcessing);
|
122
|
-
if (ts.css.icon){
|
123
|
-
t
|
124
|
-
.find('.' + ts.css.icon)
|
125
|
-
.attr('class', $(this).find('.' + ts.css.icon).attr('class'));
|
126
|
-
}
|
127
|
-
});
|
128
|
-
});
|
112
|
+
$tbl.wrap('<div class="tablesorter-scroller-table" style="height:' + h + 'px;width:' + $tbl.width() + ';overflow-y:scroll;" />')
|
129
113
|
|
130
114
|
// make scroller header sortable
|
131
115
|
ts.bindEvents(table, $cells);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-tablesorter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jun Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|