jquery-tablesorter 1.17.1 → 1.17.2
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/addons/pager/jquery.tablesorter.pager.js +6 -2
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +353 -228
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +41 -37
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +313 -192
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +2 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js +63 -48
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +17 -12
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js +10 -5
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +114 -71
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +95 -66
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +3 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +120 -59
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +510 -242
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +228 -0
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +76 -59
- metadata +3 -2
@@ -0,0 +1,228 @@
|
|
1
|
+
/*! tablesorter tbody sorting widget (BETA) - 6/10/2015 (core v2.22.2)
|
2
|
+
* Requires tablesorter v2.22.2+ and jQuery 1.4+
|
3
|
+
* by Rob Garrison
|
4
|
+
*/
|
5
|
+
/*jshint browser:true, jquery:true, unused:false */
|
6
|
+
/*global jQuery: false */
|
7
|
+
;( function( $ ) {
|
8
|
+
'use strict';
|
9
|
+
var ts = $.tablesorter;
|
10
|
+
|
11
|
+
ts.sortTbodies = {
|
12
|
+
init: function( c, wo ) {
|
13
|
+
|
14
|
+
var index, rows, txt, max, $rows,
|
15
|
+
namespace = c.namespace + 'sortTbody',
|
16
|
+
$tbodies = c.$table.children( 'tbody' ),
|
17
|
+
len = $tbodies.length;
|
18
|
+
|
19
|
+
// save serverSideSorting value; use to toggle internal row sorting
|
20
|
+
wo.sortTbody_original_serverSideSorting = c.serverSideSorting;
|
21
|
+
|
22
|
+
// include info-only tbodies - we need parsed data from *all* tbodies
|
23
|
+
wo.sortTbody_original_cssInfoBlock = c.cssInfoBlock;
|
24
|
+
c.cssInfoBlock = wo.sortTbody_noSort;
|
25
|
+
ts.sortTbodies.setTbodies( c, wo );
|
26
|
+
|
27
|
+
// add original order index for stable sort
|
28
|
+
for ( index = 0; index < len; index++ ) {
|
29
|
+
$tbodies.eq( index ).attr( 'data-ts-original-order', index );
|
30
|
+
}
|
31
|
+
|
32
|
+
c.$table
|
33
|
+
.unbind( 'sortBegin updateComplete '.split( ' ' ).join( namespace + ' ' ) )
|
34
|
+
.bind( 'sortBegin' + namespace, function() {
|
35
|
+
ts.sortTbodies.sorter( c );
|
36
|
+
})
|
37
|
+
.bind( 'updateComplete' + namespace, function() {
|
38
|
+
// find parsers for each column
|
39
|
+
ts.sortTbodies.setTbodies( c, wo );
|
40
|
+
c.$table.trigger( 'updateCache', [ null, c.$tbodies ] );
|
41
|
+
});
|
42
|
+
|
43
|
+
// detect parsers - in case the table contains only info-only tbodies
|
44
|
+
if ( $.isEmptyObject( c.parsers ) || c.$tbodies.length !== $tbodies.length ) {
|
45
|
+
ts.sortTbodies.setTbodies( c, wo );
|
46
|
+
c.$table.trigger( 'updateCache', [ null, c.$tbodies ] );
|
47
|
+
}
|
48
|
+
|
49
|
+
// find colMax; this only matter for numeric columns
|
50
|
+
$rows = $tbodies.children( 'tr' );
|
51
|
+
len = $rows.length;
|
52
|
+
for ( index = 0; index < c.columns; index++ ) {
|
53
|
+
max = 0;
|
54
|
+
if ( c.parsers[ index ].type === 'numeric' ) {
|
55
|
+
for ( rows = 0; rows < len; rows++ ) {
|
56
|
+
// update column max value (ignore sign)
|
57
|
+
txt = ts.getParsedText( c, $rows.eq( rows ).children()[ index ], index );
|
58
|
+
max = Math.max( Math.abs( txt ) || 0, max );
|
59
|
+
}
|
60
|
+
}
|
61
|
+
c.$headerIndexed[ index ].attr( 'data-ts-col-max-value', max );
|
62
|
+
}
|
63
|
+
|
64
|
+
},
|
65
|
+
|
66
|
+
// make sure c.$tbodies is up-to-date (init & after updates)
|
67
|
+
setTbodies: function( c, wo ) {
|
68
|
+
c.$tbodies = c.$table.children( 'tbody' ).not( '.' + wo.sortTbody_noSort );
|
69
|
+
},
|
70
|
+
|
71
|
+
sorter: function( c ) {
|
72
|
+
var $table = c.$table,
|
73
|
+
wo = c.widgetOptions;
|
74
|
+
|
75
|
+
// prevent multiple calls while processing
|
76
|
+
if ( wo.sortTbody_busy !== true ) {
|
77
|
+
wo.sortTbody_busy = true;
|
78
|
+
var $tbodies = $table.children( 'tbody' ).not( '.' + wo.sortTbody_noSort ),
|
79
|
+
primary = wo.sortTbody_primaryRow || 'tr:eq(0)',
|
80
|
+
sortList = c.sortList || [],
|
81
|
+
len = sortList.length;
|
82
|
+
|
83
|
+
if ( len ) {
|
84
|
+
|
85
|
+
// toggle internal row sorting
|
86
|
+
c.serverSideSorting = !wo.sortTbody_sortRows;
|
87
|
+
|
88
|
+
$tbodies.sort( function( a, b ) {
|
89
|
+
var sortListIndex, txt, dir, num, colMax, sort, col, order, colA, colB, x, y,
|
90
|
+
table = c.table,
|
91
|
+
parsers = c.parsers,
|
92
|
+
cts = c.textSorter || '',
|
93
|
+
$tbodyA = $( a ),
|
94
|
+
$tbodyB = $( b ),
|
95
|
+
$a = $tbodyA.find( primary ).children( 'td, th' ),
|
96
|
+
$b = $tbodyB.find( primary ).children( 'td, th' );
|
97
|
+
for ( sortListIndex = 0; sortListIndex < len; sortListIndex++ ) {
|
98
|
+
col = sortList[ sortListIndex ][0];
|
99
|
+
order = sortList[ sortListIndex ][1];
|
100
|
+
// sort direction, true = asc, false = desc
|
101
|
+
dir = order === 0;
|
102
|
+
// column txt - tbody A
|
103
|
+
txt = ts.getElementText( c, $a.eq( col ), col );
|
104
|
+
colA = parsers[ col ].format( txt, table, $a[ col ], col );
|
105
|
+
// column txt - tbody B
|
106
|
+
txt = ts.getElementText( c, $b.eq( col ), col );
|
107
|
+
colB = parsers[ col ].format( txt, table, $b[ col ], col );
|
108
|
+
|
109
|
+
if (c.sortStable && colA === colB && len === 1) {
|
110
|
+
return $tbodyA.attr( 'data-ts-original-order' ) - $tbodyB.attr( 'data-ts-original-order' );
|
111
|
+
}
|
112
|
+
|
113
|
+
// fallback to natural sort since it is more robust
|
114
|
+
num = /n/i.test( parsers && parsers[ col ] ? parsers[ col ].type || '' : '' );
|
115
|
+
if ( num && c.strings[ col ] ) {
|
116
|
+
colMax = c.$headerIndexed[ col ].attr( 'data-ts-col-max-value' ) ||
|
117
|
+
1.79E+308; // close to Number.MAX_VALUE
|
118
|
+
// sort strings in numerical columns
|
119
|
+
if ( typeof ( c.string[ c.strings[ col ] ] ) === 'boolean' ) {
|
120
|
+
num = ( dir ? 1 : -1 ) * ( c.string[ c.strings[ col ] ] ? -1 : 1 );
|
121
|
+
} else {
|
122
|
+
num = ( c.strings[ col ] ) ? c.string[ c.strings[ col ] ] || 0 : 0;
|
123
|
+
}
|
124
|
+
// fall back to built-in numeric sort
|
125
|
+
// var sort = $.tablesorter['sort' + s](a, b, dir, colMax, table);
|
126
|
+
sort = c.numberSorter ? c.numberSorter( colA, colB, dir, colMax, table ) :
|
127
|
+
ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( colA, colB, num, colMax, col, table );
|
128
|
+
} else {
|
129
|
+
// set a & b depending on sort direction
|
130
|
+
x = dir ? colA : colB;
|
131
|
+
y = dir ? colB : colA;
|
132
|
+
// text sort function
|
133
|
+
if ( typeof ( cts ) === 'function' ) {
|
134
|
+
// custom OVERALL text sorter
|
135
|
+
sort = cts( x, y, dir, col, table );
|
136
|
+
} else if ( typeof ( cts ) === 'object' && cts.hasOwnProperty( col ) ) {
|
137
|
+
// custom text sorter for a SPECIFIC COLUMN
|
138
|
+
sort = cts[ col ]( x, y, dir, col, table );
|
139
|
+
} else {
|
140
|
+
// fall back to natural sort
|
141
|
+
sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( colA, colB, col, table, c );
|
142
|
+
}
|
143
|
+
}
|
144
|
+
if ( sort ) { return sort; }
|
145
|
+
}
|
146
|
+
return $tbodyA.attr( 'data-ts-original-order' ) - $tbodyB.attr( 'data-ts-original-order' );
|
147
|
+
});
|
148
|
+
|
149
|
+
ts.sortTbodies.restoreTbodies ( c, wo, $tbodies );
|
150
|
+
wo.sortTbody_busy = false;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
},
|
154
|
+
|
155
|
+
restoreTbodies : function ( c, wo, $sortedTbodies ) {
|
156
|
+
var $nosort, $tbodies, $thisTbody, tbLen, nsLen, index, targetIndex,
|
157
|
+
$table = c.$table,
|
158
|
+
hasShuffled = true,
|
159
|
+
indx = 0;
|
160
|
+
|
161
|
+
// hide entire table to improve sort performance
|
162
|
+
$table.hide();
|
163
|
+
$sortedTbodies.appendTo( $table );
|
164
|
+
|
165
|
+
// reposition no-sort tbodies
|
166
|
+
$tbodies = $table.children( 'tbody' );
|
167
|
+
tbLen = $tbodies.length;
|
168
|
+
$nosort = $tbodies.filter( '.' + wo.sortTbody_noSort ).appendTo( $table );
|
169
|
+
nsLen = $nosort.length;
|
170
|
+
|
171
|
+
if ( nsLen ) {
|
172
|
+
// don't allow the while loop to cycle more times than the set number of no-sort tbodies
|
173
|
+
while ( hasShuffled && indx < nsLen ) {
|
174
|
+
hasShuffled = false;
|
175
|
+
for ( index = 0; index < nsLen; index++ ) {
|
176
|
+
targetIndex = parseInt( $nosort.eq( index ).attr( 'data-ts-original-order' ), 10 );
|
177
|
+
// if target index > number of tbodies, make it last
|
178
|
+
targetIndex = targetIndex >= tbLen ? tbLen : targetIndex < 0 ? 0 : targetIndex;
|
179
|
+
|
180
|
+
if ( targetIndex !== $nosort.eq( index ).index() ) {
|
181
|
+
hasShuffled = true;
|
182
|
+
$thisTbody = $nosort.eq( index ).detach();
|
183
|
+
|
184
|
+
if ( targetIndex >= tbLen ) {
|
185
|
+
// Are we trying to be the last tbody?
|
186
|
+
$thisTbody.appendTo( $table );
|
187
|
+
} else if ( targetIndex === 0 ) {
|
188
|
+
// Are we trying to be the first tbody?
|
189
|
+
$thisTbody.prependTo( $table );
|
190
|
+
} else {
|
191
|
+
// No, we want to be somewhere in the middle!
|
192
|
+
$thisTbody.insertBefore( $table.children( 'tbody:eq(' + targetIndex + ')' ) );
|
193
|
+
}
|
194
|
+
|
195
|
+
}
|
196
|
+
}
|
197
|
+
indx++;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
$table.show();
|
202
|
+
}
|
203
|
+
|
204
|
+
};
|
205
|
+
|
206
|
+
ts.addWidget({
|
207
|
+
id: 'sortTbody',
|
208
|
+
// priority < 50 (filter widget), so c.$tbodies has the correct elements
|
209
|
+
priority: 40,
|
210
|
+
options: {
|
211
|
+
// point to a row within the tbody that matches the number of header columns
|
212
|
+
sortTbody_primaryRow : null,
|
213
|
+
// sort tbody internal rows
|
214
|
+
sortTbody_sortRows : false,
|
215
|
+
// static tbodies (like static rows)
|
216
|
+
sortTbody_noSort : 'tablesorter-no-sort-tbody'
|
217
|
+
},
|
218
|
+
init : function( table, thisWidget, c, wo ) {
|
219
|
+
ts.sortTbodies.init( c, wo );
|
220
|
+
},
|
221
|
+
remove : function( table, c, wo, refreshing ) {
|
222
|
+
c.$table.unbind( 'sortBegin updateComplete '.split( ' ' ).join( c.namespace + 'sortTbody ' ) );
|
223
|
+
c.serverSideSorting = wo.sortTbody_original_serverSideSorting;
|
224
|
+
c.cssInfoBlock = wo.sortTbody_original_cssInfoBlock;
|
225
|
+
}
|
226
|
+
});
|
227
|
+
|
228
|
+
})( jQuery );
|
@@ -16,32 +16,34 @@ $.extend(ts.css, {
|
|
16
16
|
// Add a resize event to table headers
|
17
17
|
ts.addHeaderResizeEvent = function(table, disable, settings) {
|
18
18
|
table = $(table)[0]; // make sure we're using a dom element
|
19
|
-
|
20
|
-
|
19
|
+
if ( !table.config ) { return; }
|
20
|
+
var defaults = {
|
21
21
|
timer : 250
|
22
22
|
},
|
23
23
|
options = $.extend({}, defaults, settings),
|
24
24
|
c = table.config,
|
25
25
|
wo = c.widgetOptions,
|
26
|
-
checkSizes = function(triggerEvent) {
|
26
|
+
checkSizes = function( triggerEvent ) {
|
27
|
+
var index, headers, $header, sizes, width, height,
|
28
|
+
len = c.$headers.length;
|
27
29
|
wo.resize_flag = true;
|
28
30
|
headers = [];
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
if (width !== sizes[0] || height !== sizes[1]) {
|
35
|
-
$header.data('savedSizes', [ width, height ]);
|
36
|
-
headers.push(
|
31
|
+
for ( index = 0; index < len; index++ ) {
|
32
|
+
$header = c.$headers.eq( index );
|
33
|
+
sizes = $header.data( 'savedSizes' ) || [ 0,0 ]; // fixes #394
|
34
|
+
width = $header[0].offsetWidth;
|
35
|
+
height = $header[0].offsetHeight;
|
36
|
+
if ( width !== sizes[0] || height !== sizes[1] ) {
|
37
|
+
$header.data( 'savedSizes', [ width, height ] );
|
38
|
+
headers.push( $header[0] );
|
37
39
|
}
|
38
|
-
}
|
39
|
-
if (headers.length && triggerEvent !== false) {
|
40
|
-
c.$table.trigger('resize', [ headers ]);
|
40
|
+
}
|
41
|
+
if ( headers.length && triggerEvent !== false ) {
|
42
|
+
c.$table.trigger( 'resize', [ headers ] );
|
41
43
|
}
|
42
44
|
wo.resize_flag = false;
|
43
45
|
};
|
44
|
-
checkSizes(false);
|
46
|
+
checkSizes( false );
|
45
47
|
clearInterval(wo.resize_timer);
|
46
48
|
if (disable) {
|
47
49
|
wo.resize_flag = false;
|
@@ -77,7 +79,8 @@ ts.addWidget({
|
|
77
79
|
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
|
78
80
|
return;
|
79
81
|
}
|
80
|
-
var
|
82
|
+
var index, len, $t,
|
83
|
+
$table = c.$table,
|
81
84
|
// add position: relative to attach element, hopefully it won't cause trouble.
|
82
85
|
$attach = $(wo.stickyHeaders_attachTo),
|
83
86
|
namespace = c.namespace + 'stickyheaders ',
|
@@ -112,17 +115,19 @@ ts.addWidget({
|
|
112
115
|
laststate = '',
|
113
116
|
spacing = 0,
|
114
117
|
setWidth = function($orig, $clone){
|
115
|
-
$
|
116
|
-
|
117
|
-
|
118
|
-
|
118
|
+
var index, width, border, $cell, $this,
|
119
|
+
$cells = $orig.filter(':visible'),
|
120
|
+
len = $cells.length;
|
121
|
+
for ( index = 0; index < len; index++ ) {
|
122
|
+
$cell = $clone.filter(':visible').eq(index);
|
123
|
+
$this = $cells.eq(index);
|
119
124
|
// code from https://github.com/jmosbech/StickyTableHeaders
|
120
125
|
if ($this.css('box-sizing') === 'border-box') {
|
121
126
|
width = $this.outerWidth();
|
122
127
|
} else {
|
123
128
|
if ($cell.css('border-collapse') === 'collapse') {
|
124
129
|
if (window.getComputedStyle) {
|
125
|
-
width = parseFloat( window.getComputedStyle(this, null).width );
|
130
|
+
width = parseFloat( window.getComputedStyle($this[0], null).width );
|
126
131
|
} else {
|
127
132
|
// ie8 only
|
128
133
|
border = parseFloat( $this.css('border-width') );
|
@@ -133,10 +138,11 @@ ts.addWidget({
|
|
133
138
|
}
|
134
139
|
}
|
135
140
|
$cell.css({
|
141
|
+
'width': width,
|
136
142
|
'min-width': width,
|
137
143
|
'max-width': width
|
138
144
|
});
|
139
|
-
}
|
145
|
+
}
|
140
146
|
},
|
141
147
|
resizeHeader = function() {
|
142
148
|
stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0;
|
@@ -148,6 +154,39 @@ ts.addWidget({
|
|
148
154
|
});
|
149
155
|
setWidth( $table, $stickyTable );
|
150
156
|
setWidth( $header, $stickyCells );
|
157
|
+
},
|
158
|
+
scrollSticky = function( resizing ) {
|
159
|
+
if (!$table.is(':visible')) { return; } // fixes #278
|
160
|
+
// Detect nested tables - fixes #724
|
161
|
+
nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
|
162
|
+
var offset = $table.offset(),
|
163
|
+
yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
164
|
+
xWindow = $.isWindow( $xScroll[0] ),
|
165
|
+
// scrollTop = ( $attach.length ? $attach.offset().top : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop,
|
166
|
+
scrollTop = ( $attach.length ? ( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop,
|
167
|
+
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)),
|
168
|
+
isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
|
169
|
+
cssSettings = { visibility : isVisible };
|
170
|
+
|
171
|
+
if ($attach.length) {
|
172
|
+
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
|
173
|
+
}
|
174
|
+
if (xWindow) {
|
175
|
+
// adjust when scrolling horizontally - fixes issue #143
|
176
|
+
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
|
177
|
+
}
|
178
|
+
if ($nestedSticky.length) {
|
179
|
+
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
180
|
+
}
|
181
|
+
$stickyWrap
|
182
|
+
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
|
183
|
+
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
|
184
|
+
.css(cssSettings);
|
185
|
+
if (isVisible !== laststate || resizing) {
|
186
|
+
// make sure the column widths match
|
187
|
+
resizeHeader();
|
188
|
+
laststate = isVisible;
|
189
|
+
}
|
151
190
|
};
|
152
191
|
// only add a position relative if a position isn't already defined
|
153
192
|
if ($attach.length && !$attach.css('position')) {
|
@@ -179,48 +218,26 @@ ts.addWidget({
|
|
179
218
|
|
180
219
|
// onRenderHeader is defined, we need to do something about it (fixes #641)
|
181
220
|
if (c.onRenderHeader) {
|
182
|
-
$stickyThead.children('tr').children()
|
221
|
+
$t = $stickyThead.children('tr').children();
|
222
|
+
len = $t.length;
|
223
|
+
for ( index = 0; index < len; index++ ) {
|
183
224
|
// send second parameter
|
184
|
-
c.onRenderHeader.apply( $(
|
185
|
-
}
|
225
|
+
c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
|
226
|
+
}
|
186
227
|
}
|
187
228
|
|
188
229
|
// make it sticky!
|
189
230
|
$xScroll.add($yScroll)
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
scrollTop = ( $attach.length ? ( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop,
|
200
|
-
tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)),
|
201
|
-
isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
|
202
|
-
cssSettings = { visibility : isVisible };
|
231
|
+
.unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
|
232
|
+
.bind('scroll resize '.split(' ').join( namespace ), function( event ) {
|
233
|
+
scrollSticky( event.type === 'resize' );
|
234
|
+
});
|
235
|
+
c.$table
|
236
|
+
.unbind('stickyHeadersUpdate' + namespace)
|
237
|
+
.bind('stickyHeadersUpdate' + namespace, function(){
|
238
|
+
scrollSticky( true );
|
239
|
+
});
|
203
240
|
|
204
|
-
if ($attach.length) {
|
205
|
-
cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
|
206
|
-
}
|
207
|
-
if (xWindow) {
|
208
|
-
// adjust when scrolling horizontally - fixes issue #143
|
209
|
-
cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing;
|
210
|
-
}
|
211
|
-
if ($nestedSticky.length) {
|
212
|
-
cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
213
|
-
}
|
214
|
-
$stickyWrap
|
215
|
-
.removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
|
216
|
-
.addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide )
|
217
|
-
.css(cssSettings);
|
218
|
-
if (isVisible !== laststate || event.type === 'resize') {
|
219
|
-
// make sure the column widths match
|
220
|
-
resizeHeader();
|
221
|
-
laststate = isVisible;
|
222
|
-
}
|
223
|
-
});
|
224
241
|
if (wo.stickyHeaders_addResizeEvent) {
|
225
242
|
ts.addHeaderResizeEvent(table);
|
226
243
|
}
|
@@ -256,7 +273,7 @@ ts.addWidget({
|
|
256
273
|
var namespace = c.namespace + 'stickyheaders ';
|
257
274
|
c.$table
|
258
275
|
.removeClass('hasStickyHeaders')
|
259
|
-
.unbind( ('pagerComplete filterEnd '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
276
|
+
.unbind( ('pagerComplete filterEnd stickyHeadersUpdate '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
|
260
277
|
.next('.' + ts.css.stickyWrap).remove();
|
261
278
|
if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
|
262
279
|
$(window)
|
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.17.
|
4
|
+
version: 1.17.2
|
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: 2015-
|
12
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js
|
130
130
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-saveSort.js
|
131
131
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js
|
132
|
+
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js
|
132
133
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js
|
133
134
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js
|
134
135
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js
|