jquery-tablesorter 1.23.9 → 1.23.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ce7b71028de4f04b9a86e61b7b933b06e68e646
4
- data.tar.gz: f5168b4ec2d63cb8dfdcfc005f008dc468e823fb
3
+ metadata.gz: 3932a063e05a5d7e25e5911e2f083adfe5d42ae9
4
+ data.tar.gz: 2b7a51790860330826b96d8768853442f810980e
5
5
  SHA512:
6
- metadata.gz: 6c04f89adb80a916ad5fb0361cf28dbc4984e721d39522125d72a8e62b497e89a925744d11d7c9811572d22dcd136b94c6a213b69306e6dfa6fd538d276502e8
7
- data.tar.gz: 651032d324624fe4ac459fa3e7b7c431b371fd3bc2f1ef0ce394c4bce4d6c6dd8841138dd9b89c6d2c41315c1a9c220dd25e7139966786ee8549f8e2868dcc90
6
+ metadata.gz: 252269fcce1138445f892f973fd550d57ac86eb20cef4f295c49f5111e8b8191d9d034efd8d34dc883c81f74a07ac72df2c402dd3e0325e55f09784339940c60
7
+ data.tar.gz: d5a435c879773961da5d1dac8aff8cfe620d653f4937a753f26ee5a156c3da85c88b8012b9058e3d9c7208131a114694f4efe27ed8436b96df31fbfb1c50f2ed
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.9 (5/3/2017), [documentation]
7
+ Current tablesorter version: 2.28.10 (5/16/2017), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,7 +1,7 @@
1
1
  module JqueryTablesorter
2
2
  MAJOR = 1
3
3
  MINOR = 23
4
- TINY = 9
4
+ TINY = 10
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].compact.join('.')
7
7
  end
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
7
+ /*! tablesorter (FORK) - updated 05-16-2017 (v2.28.10)*/
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.9 *//*
19
+ /*! TableSorter (FORK) v2.28.10 *//*
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.9',
43
+ version : '2.28.10',
44
44
 
45
45
  parsers : [],
46
46
  widgets : [],
@@ -272,11 +272,6 @@
272
272
  if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
273
273
  tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
274
274
  }
275
- c.table = table;
276
- c.$table = $table
277
- .addClass( ts.css.table + ' ' + c.tableClass + tmp )
278
- .attr( 'role', 'grid' );
279
- c.$headers = $table.find( c.selectorHeaders );
280
275
 
281
276
  // give the table a unique id, which will be used in namespace binding
282
277
  if ( !c.namespace ) {
@@ -286,6 +281,14 @@
286
281
  c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
287
282
  }
288
283
 
284
+ c.table = table;
285
+ c.$table = $table
286
+ // add namespace to table to allow bindings on extra elements to target
287
+ // the parent table (e.g. parser-input-select)
288
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
289
+ .attr( 'role', 'grid' );
290
+ c.$headers = $table.find( c.selectorHeaders );
291
+
289
292
  c.$table.children().children( 'tr' ).attr( 'role', 'row' );
290
293
  c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
291
294
  'aria-live' : 'polite',
@@ -1304,6 +1307,12 @@
1304
1307
  },
1305
1308
 
1306
1309
  updateCell : function( c, cell, resort, callback ) {
1310
+ // updateCell for child rows is a mess - we'll ignore them for now
1311
+ // eventually I'll break out the "update" row cache code to make everything consistent
1312
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
1313
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
1314
+ return;
1315
+ }
1307
1316
  if ( ts.isEmptyObject( c.cache ) ) {
1308
1317
  // empty table, do an update instead - fixes #1099
1309
1318
  ts.updateHeader( c );
@@ -2522,6 +2531,7 @@
2522
2531
  .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
2523
2532
  ts.restoreHeaders( table );
2524
2533
  $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
2534
+ $t.removeClass(c.namespace.slice(1));
2525
2535
  // clear flag in case the plugin is initialized again
2526
2536
  table.hasInitialized = false;
2527
2537
  delete table.config.cache;
@@ -1,4 +1,4 @@
1
- /*! TableSorter (FORK) v2.28.9 *//*
1
+ /*! TableSorter (FORK) v2.28.10 *//*
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.9',
25
+ version : '2.28.10',
26
26
 
27
27
  parsers : [],
28
28
  widgets : [],
@@ -254,11 +254,6 @@
254
254
  if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
255
255
  tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
256
256
  }
257
- c.table = table;
258
- c.$table = $table
259
- .addClass( ts.css.table + ' ' + c.tableClass + tmp )
260
- .attr( 'role', 'grid' );
261
- c.$headers = $table.find( c.selectorHeaders );
262
257
 
263
258
  // give the table a unique id, which will be used in namespace binding
264
259
  if ( !c.namespace ) {
@@ -268,6 +263,14 @@
268
263
  c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
269
264
  }
270
265
 
266
+ c.table = table;
267
+ c.$table = $table
268
+ // add namespace to table to allow bindings on extra elements to target
269
+ // the parent table (e.g. parser-input-select)
270
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
271
+ .attr( 'role', 'grid' );
272
+ c.$headers = $table.find( c.selectorHeaders );
273
+
271
274
  c.$table.children().children( 'tr' ).attr( 'role', 'row' );
272
275
  c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
273
276
  'aria-live' : 'polite',
@@ -1286,6 +1289,12 @@
1286
1289
  },
1287
1290
 
1288
1291
  updateCell : function( c, cell, resort, callback ) {
1292
+ // updateCell for child rows is a mess - we'll ignore them for now
1293
+ // eventually I'll break out the "update" row cache code to make everything consistent
1294
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
1295
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
1296
+ return;
1297
+ }
1289
1298
  if ( ts.isEmptyObject( c.cache ) ) {
1290
1299
  // empty table, do an update instead - fixes #1099
1291
1300
  ts.updateHeader( c );
@@ -2504,6 +2513,7 @@
2504
2513
  .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
2505
2514
  ts.restoreHeaders( table );
2506
2515
  $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
2516
+ $t.removeClass(c.namespace.slice(1));
2507
2517
  // clear flag in case the plugin is initialized again
2508
2518
  table.hasInitialized = false;
2509
2519
  delete table.config.cache;
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
7
+ /*! tablesorter (FORK) - updated 05-16-2017 (v2.28.10)*/
8
8
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -1,4 +1,4 @@
1
- /*! Parser: input & select - updated 11/26/2016 (v2.28.0) *//*
1
+ /*! Parser: input & select - updated 5/16/2017 (v2.28.10) *//*
2
2
  * for jQuery 1.7+ & tablesorter 2.7.11+
3
3
  * Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
4
4
  */
@@ -131,31 +131,54 @@
131
131
  $row.removeClass( checkboxClass );
132
132
  }
133
133
  },
134
+ updateCheckbox = function($el, state) {
135
+ if ($el[0].nodeName !== 'INPUT') {
136
+ $el = $el.find( 'input[type="checkbox"]' );
137
+ }
138
+ if ($el.length) {
139
+ var ua = window.navigator.userAgent;
140
+ if (state === 'indeterminate') {
141
+ // needed for IE
142
+ $el.prop('checked', !(ua.indexOf('Trident/') > -1 || ua.indexOf('Edge/') > -1));
143
+ $el.prop('indeterminate', true);
144
+ } else {
145
+ $el.prop('checked', state);
146
+ $el.prop('indeterminate', false);
147
+ }
148
+ }
149
+ },
134
150
  updateHeaderCheckbox = function( $table, checkboxClass ) {
135
- var ua = window.navigator.userAgent,
136
- $rows = $table.children( 'tbody' ).children( ':visible' ), // (include child rows?)
137
- len = $rows.length;
151
+ var $rows = $table.children( 'tbody' ).children( ':visible' ), // (include child rows?)
152
+ len = $rows.length,
153
+ hasSticky = $table[0].config.widgetOptions.$sticky;
138
154
  // set indeterminate state on header checkbox
139
155
  $table.children( 'thead' ).find( 'input[type="checkbox"]' ).each( function() {
140
156
  var column = $( this ).closest( 'td, th' ).attr( 'data-column' ),
157
+ $sticky = hasSticky.find( '[data-column="' + column + '"]' ),
141
158
  vis = $rows.filter( '.' + checkboxClass + '-' + column ).length,
142
159
  allChecked = vis === len && len > 0;
143
160
  if ( vis === 0 || allChecked ) {
144
- this.checked = allChecked;
145
- this.indeterminate = false;
161
+ updateCheckbox($(this), allChecked);
162
+ if ($sticky) {
163
+ updateCheckbox($sticky, allChecked);
164
+ }
146
165
  } else {
147
- // needed for IE
148
- this.checked = !(ua.indexOf('Trident/') > -1 || ua.indexOf('Edge/') > -1);
149
- this.indeterminate = true;
166
+ updateCheckbox($(this), 'indeterminate');
167
+ if ($sticky) {
168
+ updateCheckbox($sticky, 'indeterminate');
169
+ }
150
170
  }
151
171
  });
172
+
152
173
  };
153
174
 
154
175
  $( 'table' ).on( 'tablesorter-initialized updateComplete', function() {
155
176
  this.tablesorterBusy = false;
156
177
  var namespace = '.parser-forms';
157
- // bind to .tablesorter (default class name)
158
- $( this ).children( 'tbody' )
178
+ $( this )
179
+ // add namespace to table in case of version mismatch (v2.28.10)
180
+ .addClass( this.config.namespace.slice(1) )
181
+ .children( 'tbody' )
159
182
  .off( namespace )
160
183
  .on( 'mouseleave' + namespace, function( event ) {
161
184
  // make sure we restore original values (trigger blur)
@@ -165,15 +188,30 @@
165
188
  $( ':focus' ).blur();
166
189
  }
167
190
  })
168
- .on( 'focus' + namespace, 'select, input:not([type=checkbox]), textarea', function() {
191
+ .on( 'focus' + namespace, 'select, input:not([type=checkbox]), textarea', function( event ) {
192
+ var $row = $( event.target ).closest( 'tr' ),
193
+ c = $row.closest( 'table' )[0].config;
194
+ if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
195
+ return;
196
+ }
169
197
  $( this ).data( 'ts-original-value', this.value );
170
198
  })
171
- .on( 'blur' + namespace, 'input:not([type=checkbox]), textarea', function() {
199
+ .on( 'blur' + namespace, 'input:not([type=checkbox]), textarea', function( event ) {
200
+ var $row = $( event.target ).closest( 'tr' ),
201
+ c = $row.closest( 'table' )[0].config;
202
+ if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
203
+ return;
204
+ }
172
205
  // restore input value;
173
206
  // 'change' is triggered before 'blur' so this doesn't replace the new update with the original
174
207
  this.value = $( this ).data( 'ts-original-value' );
175
208
  })
176
209
  .on( 'change keyup '.split( ' ' ).join( namespace + ' ' ), 'select, input, textarea', function( event ) {
210
+ var $row = $( this ).closest( 'tr' ),
211
+ c = $row.closest( 'table' )[0].config;
212
+ if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
213
+ return;
214
+ }
177
215
  if ( event.which === 27 && !( this.nodeName === 'INPUT' && this.type === 'checkbox' ) ) {
178
216
  // escape: restore original value
179
217
  this.value = $( this ).data( 'ts-original-value' );
@@ -187,11 +225,9 @@
187
225
  $target = $( event.target ),
188
226
  isCheckbox = event.target.type === 'checkbox',
189
227
  $cell = $target.closest( 'td' ),
190
- $table = $cell.closest( 'table' ),
191
228
  indx = $cell[ 0 ].cellIndex,
192
- c = $table[ 0 ].config || false,
193
- busy = $table.length && $table[ 0 ].tablesorterBusy,
194
- $hdr = c && c.$headerIndexed && c.$headerIndexed[ indx ] || [],
229
+ busy = c.table.tablesorterBusy,
230
+ $hdr = c.$headerIndexed && c.$headerIndexed[ indx ] || [],
195
231
  val = isCheckbox ? event.target.checked : $target.val();
196
232
  // abort if not a tablesorter table, or busy
197
233
  if ( $.isEmptyObject( c ) || busy !== false ) {
@@ -200,7 +236,7 @@
200
236
  if ( isCheckbox ) {
201
237
  checkboxClass = c.checkboxClass || 'checked';
202
238
  toggleRowClass( $cell.closest( 'tr' ), checkboxClass, indx, val );
203
- updateHeaderCheckbox( $table, checkboxClass );
239
+ updateHeaderCheckbox( c.$table, checkboxClass );
204
240
  }
205
241
  // don't use updateCell if column is set to 'sorter-false' and 'filter-false',
206
242
  // or column is set to 'parser-false'
@@ -213,11 +249,11 @@
213
249
  // ignore change event if nothing changed
214
250
  if ( c && val !== $target.data( 'ts-original-value' ) || isCheckbox ) {
215
251
  $target.data( 'ts-original-value', val );
216
- $table[ 0 ].tablesorterBusy = true;
252
+ c.table.tablesorterBusy = true;
217
253
  // pass undefined resort value so it falls back to config.resort setting
218
254
  $.tablesorter.updateCell( c, $cell, undef, function() {
219
- updateServer( event, $table, $target );
220
- $table[ 0 ].tablesorterBusy = false;
255
+ updateServer( event, c.$table, $target );
256
+ c.table.tablesorterBusy = false;
221
257
  });
222
258
  }
223
259
  }
@@ -240,32 +276,45 @@
240
276
  }
241
277
  })
242
278
  .children( 'thead' )
279
+ .add( this.config.widgetOptions.$sticky )
243
280
  .off( namespace )
244
281
  // modified from http://jsfiddle.net/abkNM/6163/
245
282
  // click needed for IE; a change isn't fired when going from an indeterminate checkbox to
246
283
  // either checked or unchecked
247
284
  .on( 'click' + namespace + ' change' + namespace, 'input[type="checkbox"]', function( event ) {
248
- var undef, onlyVisible, column, $target, isParsed, checkboxClass,
285
+ var c, undef, onlyVisible, column, $target, isParsed, checkboxClass,
249
286
  $checkbox = $( this ),
287
+ isChecked = this.checked,
250
288
  $table = $checkbox.closest( 'table' ),
251
- c = $table.length && $table[ 0 ].config,
252
- isChecked = this.checked;
289
+ isSticky = $table.length && $table[0].className.match(/(tablesorter\w+)_extra_table/);
290
+ if (isSticky) {
291
+ isSticky = isSticky[1];
292
+ $table = $('.' + isSticky + ':not(.' + isSticky + '_extra_table)');
293
+ }
294
+ c = $table.length && $table[ 0 ].config;
253
295
  if ( $table.length && c && !$table[ 0 ].tablesorterBusy ) {
254
296
  column = parseInt( $checkbox.closest( 'td, th' ).attr( 'data-column' ), 10 );
255
297
  isParsed = c.parsers[ column ].id === 'checkbox';
256
- onlyVisible = $table.length && c.checkboxVisible;
298
+ onlyVisible = c.checkboxVisible;
257
299
  $table[ 0 ].tablesorterBusy = true; // prevent "change" event from calling updateCell numerous times (see #971)
258
- $target = $table
259
- .children( 'tbody' )
260
- .children( 'tr' + ( typeof onlyVisible === 'undefined' || onlyVisible === true ? ':visible' : '' ) )
261
- .children( ':nth-child(' + ( column + 1 ) + ')' )
262
- .find( 'input[type="checkbox"]' )
263
- .prop( 'checked', isChecked );
300
+ updateCheckbox(
301
+ $target = $table
302
+ .children( 'tbody' )
303
+ .children( 'tr' + ( typeof onlyVisible === 'undefined' || onlyVisible === true ? ':visible' : '' ) )
304
+ .children( ':nth-child(' + ( column + 1 ) + ')' ),
305
+ isChecked
306
+ );
264
307
  // add checkbox class names to row
265
308
  checkboxClass = c.checkboxClass || 'checked';
266
309
  $target.each( function() {
267
310
  toggleRowClass( $( this ).closest( 'tr' ), checkboxClass, column, isChecked );
268
311
  });
312
+ if (isSticky) {
313
+ // make main table checkbox match sticky header checkbox
314
+ updateCheckbox($table.children( 'thead' ).find( '[data-column="' + column + '"]' ), isChecked);
315
+ } else if (c.widgetOptions.$sticky) {
316
+ updateCheckbox(c.widgetOptions.$sticky.find( 'thead' ).find( '[data-column="' + column + '"]' ), isChecked);
317
+ }
269
318
  updateHeaderCheckbox( $table, checkboxClass );
270
319
  if ( isParsed ) {
271
320
  // only update cache if checkboxes are being sorted
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.9
4
+ version: 1.23.10
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-05-05 00:00:00.000000000 Z
12
+ date: 2017-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties