jquery-tablesorter 1.23.12 → 1.23.13
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.combined.js +45 -28
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +29 -16
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +16 -12
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +15 -11
- 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: 4599b415cfd55b6691b1ab65afe7fd151d5eca4b
|
4
|
+
data.tar.gz: 79c6f86cee61f56dcbd3ab71f9ca834cf55301b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0466a10d6c849257f48466028714faae3795993dc7d334233ed0832cd59519147adffc3b32777b1b4647000131b4de0f49b041595ab4e3d4a16ed6121f6a5fb5
|
7
|
+
data.tar.gz: 01217de0c92d25f0e849989ae7fe9a218a595be7692b0d9fa51f8204cb9ba5ba54d87506693ce988a7e9dc9cd41c18719d838e6184431998ba447e0f618aabd9
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Simple integration of jQuery tablesorter ([Mottie's fork]) into the asset pipeline.
|
6
6
|
|
7
|
-
Current tablesorter version: 2.28.
|
7
|
+
Current tablesorter version: 2.28.13 (6/2/2017) [documentation]
|
8
8
|
|
9
9
|
Any issue associated with the js/css files, please report to [Mottie's fork].
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
|
8
8
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9
9
|
(function(factory) {
|
10
10
|
if (typeof define === 'function' && define.amd) {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
}(function(jQuery) {
|
18
18
|
|
19
|
-
/*! TableSorter (FORK) v2.28.
|
19
|
+
/*! TableSorter (FORK) v2.28.13 *//*
|
20
20
|
* Client-side table sorting with ease!
|
21
21
|
* @requires jQuery v1.2.6+
|
22
22
|
*
|
@@ -40,7 +40,7 @@
|
|
40
40
|
'use strict';
|
41
41
|
var ts = $.tablesorter = {
|
42
42
|
|
43
|
-
version : '2.28.
|
43
|
+
version : '2.28.13',
|
44
44
|
|
45
45
|
parsers : [],
|
46
46
|
widgets : [],
|
@@ -116,6 +116,7 @@
|
|
116
116
|
cssIconNone : '', // class name added to the icon when there is no column sort
|
117
117
|
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
|
118
118
|
cssIconDesc : '', // class name added to the icon when the column has a descending sort
|
119
|
+
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
|
119
120
|
|
120
121
|
// *** events
|
121
122
|
pointerClick : 'click',
|
@@ -1092,7 +1093,7 @@
|
|
1092
1093
|
▀████▀ ██ █████▀ ██ ██ ██ ██████
|
1093
1094
|
*/
|
1094
1095
|
setHeadersCss : function( c ) {
|
1095
|
-
var
|
1096
|
+
var indx, column,
|
1096
1097
|
list = c.sortList,
|
1097
1098
|
len = list.length,
|
1098
1099
|
none = ts.css.sortNone + ' ' + c.cssNone,
|
@@ -1100,20 +1101,32 @@
|
|
1100
1101
|
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
|
1101
1102
|
aria = [ 'ascending', 'descending' ],
|
1102
1103
|
// find the footer
|
1103
|
-
$
|
1104
|
+
$extras = c.$table
|
1104
1105
|
.find( 'tfoot tr' )
|
1105
1106
|
.children( 'td, th' )
|
1106
1107
|
.add( $( c.namespace + '_extra_headers' ) )
|
1107
|
-
.removeClass( css.join( ' ' ) )
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1108
|
+
.removeClass( css.join( ' ' ) ),
|
1109
|
+
// remove all header information
|
1110
|
+
$sorted = c.$headers
|
1111
|
+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
|
1112
|
+
.removeClass( css.join( ' ' ) )
|
1113
|
+
.addClass( none )
|
1114
|
+
.attr( 'aria-sort', 'none' )
|
1115
|
+
.find( '.' + ts.css.icon )
|
1116
|
+
.removeClass( cssIcon.join( ' ' ) )
|
1117
|
+
.end();
|
1118
|
+
// add css none to all sortable headers
|
1119
|
+
$sorted
|
1120
|
+
.not( '.sorter-false' )
|
1114
1121
|
.find( '.' + ts.css.icon )
|
1115
|
-
.removeClass( cssIcon.join( ' ' ) )
|
1116
1122
|
.addClass( cssIcon[ 2 ] );
|
1123
|
+
// add disabled css icon class
|
1124
|
+
if ( c.cssIconDisabled ) {
|
1125
|
+
$sorted
|
1126
|
+
.filter( '.sorter-false' )
|
1127
|
+
.find( '.' + ts.css.icon )
|
1128
|
+
.addClass( c.cssIconDisabled );
|
1129
|
+
}
|
1117
1130
|
for ( indx = 0; indx < len; indx++ ) {
|
1118
1131
|
// direction = 2 means reset!
|
1119
1132
|
if ( list[ indx ][ 1 ] !== 2 ) {
|
@@ -1150,8 +1163,8 @@
|
|
1150
1163
|
}
|
1151
1164
|
}
|
1152
1165
|
// add sorted class to footer & extra headers, if they exist
|
1153
|
-
if ( $
|
1154
|
-
$
|
1166
|
+
if ( $extras.length ) {
|
1167
|
+
$extras
|
1155
1168
|
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
|
1156
1169
|
.removeClass( none )
|
1157
1170
|
.addClass( css[ list[ indx ][ 1 ] ] );
|
@@ -1824,10 +1837,10 @@
|
|
1824
1837
|
},
|
1825
1838
|
|
1826
1839
|
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
|
1827
|
-
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
|
1828
|
-
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
|
1829
1840
|
sortNatural : function( a, b ) {
|
1830
1841
|
if ( a === b ) { return 0; }
|
1842
|
+
a = a.toString();
|
1843
|
+
b = b.toString();
|
1831
1844
|
var aNum, bNum, aFloat, bFloat, indx, max,
|
1832
1845
|
regex = ts.regex;
|
1833
1846
|
// first try and sort Hex codes
|
@@ -5152,7 +5165,7 @@
|
|
5152
5165
|
|
5153
5166
|
})( jQuery );
|
5154
5167
|
|
5155
|
-
/*! Widget: stickyHeaders - updated
|
5168
|
+
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
|
5156
5169
|
* Requires tablesorter v2.8+ and jQuery 1.4.3+
|
5157
5170
|
* by Rob Garrison
|
5158
5171
|
*/
|
@@ -5209,6 +5222,13 @@
|
|
5209
5222
|
}, options.timer);
|
5210
5223
|
};
|
5211
5224
|
|
5225
|
+
function getStickyOffset(c, wo) {
|
5226
|
+
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
|
5227
|
+
return $el.length ?
|
5228
|
+
$el.height() || 0 :
|
5229
|
+
parseInt(wo.stickyHeaders_offset, 10) || 0;
|
5230
|
+
}
|
5231
|
+
|
5212
5232
|
// Sticky headers based on this awesome article:
|
5213
5233
|
// http://css-tricks.com/13465-persistent-headers/
|
5214
5234
|
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
|
@@ -5245,8 +5265,7 @@
|
|
5245
5265
|
$thead = $table.children('thead:first'),
|
5246
5266
|
$header = $thead.children('tr').not('.sticky-false').children(),
|
5247
5267
|
$tfoot = $table.children('tfoot'),
|
5248
|
-
|
5249
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
|
5268
|
+
stickyOffset = getStickyOffset(c, wo),
|
5250
5269
|
// is this table nested? If so, find parent sticky header wrapper (div, not table)
|
5251
5270
|
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
|
5252
5271
|
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
|
@@ -5268,7 +5287,6 @@
|
|
5268
5287
|
$stickyThead = $stickyTable.children('thead:first'),
|
5269
5288
|
$stickyCells,
|
5270
5289
|
laststate = '',
|
5271
|
-
spacing = 0,
|
5272
5290
|
setWidth = function($orig, $clone){
|
5273
5291
|
var index, width, border, $cell, $this,
|
5274
5292
|
$cells = $orig.filter(':visible'),
|
@@ -5300,11 +5318,9 @@
|
|
5300
5318
|
}
|
5301
5319
|
},
|
5302
5320
|
resizeHeader = function() {
|
5303
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
|
5304
|
-
spacing = 0;
|
5305
5321
|
$stickyWrap.css({
|
5306
5322
|
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
|
5307
|
-
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
5323
|
+
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
|
5308
5324
|
width: $table.outerWidth()
|
5309
5325
|
});
|
5310
5326
|
setWidth( $table, $stickyTable );
|
@@ -5315,6 +5331,7 @@
|
|
5315
5331
|
// Detect nested tables - fixes #724
|
5316
5332
|
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
|
5317
5333
|
var offset = $table.offset(),
|
5334
|
+
stickyOffset = getStickyOffset(c, wo),
|
5318
5335
|
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
5319
5336
|
xWindow = $.isWindow( $xScroll[0] ),
|
5320
5337
|
attachTop = $attach.length ?
|
@@ -5330,11 +5347,9 @@
|
|
5330
5347
|
}
|
5331
5348
|
if (xWindow) {
|
5332
5349
|
// adjust when scrolling horizontally - fixes issue #143
|
5333
|
-
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
5334
|
-
}
|
5335
|
-
if ($nestedSticky.length) {
|
5336
|
-
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
5350
|
+
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
|
5337
5351
|
}
|
5352
|
+
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
5338
5353
|
$stickyWrap
|
5339
5354
|
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
|
5340
5355
|
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
|
@@ -5434,6 +5449,8 @@
|
|
5434
5449
|
});
|
5435
5450
|
}
|
5436
5451
|
|
5452
|
+
// make sure sticky is visible if page is partially scrolled
|
5453
|
+
scrollSticky( true );
|
5437
5454
|
$table.triggerHandler('stickyHeadersInit');
|
5438
5455
|
|
5439
5456
|
},
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! TableSorter (FORK) v2.28.
|
1
|
+
/*! TableSorter (FORK) v2.28.13 *//*
|
2
2
|
* Client-side table sorting with ease!
|
3
3
|
* @requires jQuery v1.2.6+
|
4
4
|
*
|
@@ -22,7 +22,7 @@
|
|
22
22
|
'use strict';
|
23
23
|
var ts = $.tablesorter = {
|
24
24
|
|
25
|
-
version : '2.28.
|
25
|
+
version : '2.28.13',
|
26
26
|
|
27
27
|
parsers : [],
|
28
28
|
widgets : [],
|
@@ -98,6 +98,7 @@
|
|
98
98
|
cssIconNone : '', // class name added to the icon when there is no column sort
|
99
99
|
cssIconAsc : '', // class name added to the icon when the column has an ascending sort
|
100
100
|
cssIconDesc : '', // class name added to the icon when the column has a descending sort
|
101
|
+
cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
|
101
102
|
|
102
103
|
// *** events
|
103
104
|
pointerClick : 'click',
|
@@ -1074,7 +1075,7 @@
|
|
1074
1075
|
▀████▀ ██ █████▀ ██ ██ ██ ██████
|
1075
1076
|
*/
|
1076
1077
|
setHeadersCss : function( c ) {
|
1077
|
-
var
|
1078
|
+
var indx, column,
|
1078
1079
|
list = c.sortList,
|
1079
1080
|
len = list.length,
|
1080
1081
|
none = ts.css.sortNone + ' ' + c.cssNone,
|
@@ -1082,20 +1083,32 @@
|
|
1082
1083
|
cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
|
1083
1084
|
aria = [ 'ascending', 'descending' ],
|
1084
1085
|
// find the footer
|
1085
|
-
$
|
1086
|
+
$extras = c.$table
|
1086
1087
|
.find( 'tfoot tr' )
|
1087
1088
|
.children( 'td, th' )
|
1088
1089
|
.add( $( c.namespace + '_extra_headers' ) )
|
1089
|
-
.removeClass( css.join( ' ' ) )
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1090
|
+
.removeClass( css.join( ' ' ) ),
|
1091
|
+
// remove all header information
|
1092
|
+
$sorted = c.$headers
|
1093
|
+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
|
1094
|
+
.removeClass( css.join( ' ' ) )
|
1095
|
+
.addClass( none )
|
1096
|
+
.attr( 'aria-sort', 'none' )
|
1097
|
+
.find( '.' + ts.css.icon )
|
1098
|
+
.removeClass( cssIcon.join( ' ' ) )
|
1099
|
+
.end();
|
1100
|
+
// add css none to all sortable headers
|
1101
|
+
$sorted
|
1102
|
+
.not( '.sorter-false' )
|
1096
1103
|
.find( '.' + ts.css.icon )
|
1097
|
-
.removeClass( cssIcon.join( ' ' ) )
|
1098
1104
|
.addClass( cssIcon[ 2 ] );
|
1105
|
+
// add disabled css icon class
|
1106
|
+
if ( c.cssIconDisabled ) {
|
1107
|
+
$sorted
|
1108
|
+
.filter( '.sorter-false' )
|
1109
|
+
.find( '.' + ts.css.icon )
|
1110
|
+
.addClass( c.cssIconDisabled );
|
1111
|
+
}
|
1099
1112
|
for ( indx = 0; indx < len; indx++ ) {
|
1100
1113
|
// direction = 2 means reset!
|
1101
1114
|
if ( list[ indx ][ 1 ] !== 2 ) {
|
@@ -1132,8 +1145,8 @@
|
|
1132
1145
|
}
|
1133
1146
|
}
|
1134
1147
|
// add sorted class to footer & extra headers, if they exist
|
1135
|
-
if ( $
|
1136
|
-
$
|
1148
|
+
if ( $extras.length ) {
|
1149
|
+
$extras
|
1137
1150
|
.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' )
|
1138
1151
|
.removeClass( none )
|
1139
1152
|
.addClass( css[ list[ indx ][ 1 ] ] );
|
@@ -1806,10 +1819,10 @@
|
|
1806
1819
|
},
|
1807
1820
|
|
1808
1821
|
// Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
|
1809
|
-
// this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
|
1810
|
-
// I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
|
1811
1822
|
sortNatural : function( a, b ) {
|
1812
1823
|
if ( a === b ) { return 0; }
|
1824
|
+
a = a.toString();
|
1825
|
+
b = b.toString();
|
1813
1826
|
var aNum, bNum, aFloat, bFloat, indx, max,
|
1814
1827
|
regex = ts.regex;
|
1815
1828
|
// first try and sort Hex codes
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 06-02-2017 (v2.28.13)*/
|
8
8
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9
9
|
(function(factory) {
|
10
10
|
if (typeof define === 'function' && define.amd) {
|
@@ -2332,7 +2332,7 @@
|
|
2332
2332
|
|
2333
2333
|
})( jQuery );
|
2334
2334
|
|
2335
|
-
/*! Widget: stickyHeaders - updated
|
2335
|
+
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
|
2336
2336
|
* Requires tablesorter v2.8+ and jQuery 1.4.3+
|
2337
2337
|
* by Rob Garrison
|
2338
2338
|
*/
|
@@ -2389,6 +2389,13 @@
|
|
2389
2389
|
}, options.timer);
|
2390
2390
|
};
|
2391
2391
|
|
2392
|
+
function getStickyOffset(c, wo) {
|
2393
|
+
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
|
2394
|
+
return $el.length ?
|
2395
|
+
$el.height() || 0 :
|
2396
|
+
parseInt(wo.stickyHeaders_offset, 10) || 0;
|
2397
|
+
}
|
2398
|
+
|
2392
2399
|
// Sticky headers based on this awesome article:
|
2393
2400
|
// http://css-tricks.com/13465-persistent-headers/
|
2394
2401
|
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
|
@@ -2425,8 +2432,7 @@
|
|
2425
2432
|
$thead = $table.children('thead:first'),
|
2426
2433
|
$header = $thead.children('tr').not('.sticky-false').children(),
|
2427
2434
|
$tfoot = $table.children('tfoot'),
|
2428
|
-
|
2429
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
|
2435
|
+
stickyOffset = getStickyOffset(c, wo),
|
2430
2436
|
// is this table nested? If so, find parent sticky header wrapper (div, not table)
|
2431
2437
|
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
|
2432
2438
|
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
|
@@ -2448,7 +2454,6 @@
|
|
2448
2454
|
$stickyThead = $stickyTable.children('thead:first'),
|
2449
2455
|
$stickyCells,
|
2450
2456
|
laststate = '',
|
2451
|
-
spacing = 0,
|
2452
2457
|
setWidth = function($orig, $clone){
|
2453
2458
|
var index, width, border, $cell, $this,
|
2454
2459
|
$cells = $orig.filter(':visible'),
|
@@ -2480,11 +2485,9 @@
|
|
2480
2485
|
}
|
2481
2486
|
},
|
2482
2487
|
resizeHeader = function() {
|
2483
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
|
2484
|
-
spacing = 0;
|
2485
2488
|
$stickyWrap.css({
|
2486
2489
|
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
|
2487
|
-
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
2490
|
+
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
|
2488
2491
|
width: $table.outerWidth()
|
2489
2492
|
});
|
2490
2493
|
setWidth( $table, $stickyTable );
|
@@ -2495,6 +2498,7 @@
|
|
2495
2498
|
// Detect nested tables - fixes #724
|
2496
2499
|
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
|
2497
2500
|
var offset = $table.offset(),
|
2501
|
+
stickyOffset = getStickyOffset(c, wo),
|
2498
2502
|
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
2499
2503
|
xWindow = $.isWindow( $xScroll[0] ),
|
2500
2504
|
attachTop = $attach.length ?
|
@@ -2510,11 +2514,9 @@
|
|
2510
2514
|
}
|
2511
2515
|
if (xWindow) {
|
2512
2516
|
// adjust when scrolling horizontally - fixes issue #143
|
2513
|
-
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
2514
|
-
}
|
2515
|
-
if ($nestedSticky.length) {
|
2516
|
-
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
2517
|
+
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
|
2517
2518
|
}
|
2519
|
+
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
2518
2520
|
$stickyWrap
|
2519
2521
|
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
|
2520
2522
|
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
|
@@ -2614,6 +2616,8 @@
|
|
2614
2616
|
});
|
2615
2617
|
}
|
2616
2618
|
|
2619
|
+
// make sure sticky is visible if page is partially scrolled
|
2620
|
+
scrollSticky( true );
|
2617
2621
|
$table.triggerHandler('stickyHeadersInit');
|
2618
2622
|
|
2619
2623
|
},
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: stickyHeaders - updated
|
1
|
+
/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//*
|
2
2
|
* Requires tablesorter v2.8+ and jQuery 1.4.3+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -55,6 +55,13 @@
|
|
55
55
|
}, options.timer);
|
56
56
|
};
|
57
57
|
|
58
|
+
function getStickyOffset(c, wo) {
|
59
|
+
var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
|
60
|
+
return $el.length ?
|
61
|
+
$el.height() || 0 :
|
62
|
+
parseInt(wo.stickyHeaders_offset, 10) || 0;
|
63
|
+
}
|
64
|
+
|
58
65
|
// Sticky headers based on this awesome article:
|
59
66
|
// http://css-tricks.com/13465-persistent-headers/
|
60
67
|
// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
|
@@ -91,8 +98,7 @@
|
|
91
98
|
$thead = $table.children('thead:first'),
|
92
99
|
$header = $thead.children('tr').not('.sticky-false').children(),
|
93
100
|
$tfoot = $table.children('tfoot'),
|
94
|
-
|
95
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0,
|
101
|
+
stickyOffset = getStickyOffset(c, wo),
|
96
102
|
// is this table nested? If so, find parent sticky header wrapper (div, not table)
|
97
103
|
$nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
|
98
104
|
$table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
|
@@ -114,7 +120,6 @@
|
|
114
120
|
$stickyThead = $stickyTable.children('thead:first'),
|
115
121
|
$stickyCells,
|
116
122
|
laststate = '',
|
117
|
-
spacing = 0,
|
118
123
|
setWidth = function($orig, $clone){
|
119
124
|
var index, width, border, $cell, $this,
|
120
125
|
$cells = $orig.filter(':visible'),
|
@@ -146,11 +151,9 @@
|
|
146
151
|
}
|
147
152
|
},
|
148
153
|
resizeHeader = function() {
|
149
|
-
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
|
150
|
-
spacing = 0;
|
151
154
|
$stickyWrap.css({
|
152
155
|
left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 :
|
153
|
-
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
156
|
+
$table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(),
|
154
157
|
width: $table.outerWidth()
|
155
158
|
});
|
156
159
|
setWidth( $table, $stickyTable );
|
@@ -161,6 +164,7 @@
|
|
161
164
|
// Detect nested tables - fixes #724
|
162
165
|
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
|
163
166
|
var offset = $table.offset(),
|
167
|
+
stickyOffset = getStickyOffset(c, wo),
|
164
168
|
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
165
169
|
xWindow = $.isWindow( $xScroll[0] ),
|
166
170
|
attachTop = $attach.length ?
|
@@ -176,11 +180,9 @@
|
|
176
180
|
}
|
177
181
|
if (xWindow) {
|
178
182
|
// adjust when scrolling horizontally - fixes issue #143
|
179
|
-
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft()
|
180
|
-
}
|
181
|
-
if ($nestedSticky.length) {
|
182
|
-
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
183
|
+
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft();
|
183
184
|
}
|
185
|
+
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
184
186
|
$stickyWrap
|
185
187
|
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
|
186
188
|
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
|
@@ -280,6 +282,8 @@
|
|
280
282
|
});
|
281
283
|
}
|
282
284
|
|
285
|
+
// make sure sticky is visible if page is partially scrolled
|
286
|
+
scrollSticky( true );
|
283
287
|
$table.triggerHandler('stickyHeadersInit');
|
284
288
|
|
285
289
|
},
|
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.23.
|
4
|
+
version: 1.23.13
|
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: 2017-
|
12
|
+
date: 2017-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|