jquery-tablesorter 1.16.4 → 1.16.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e0cf6bbed8cef35f8c06f69d9cd34656cabe552
4
- data.tar.gz: d35fb81a407e3cdada26f41ad02defd7bef200de
3
+ metadata.gz: a506f228e740d405af7dbf96ff2dddcc8a17bfbd
4
+ data.tar.gz: 2a3dd948476f1f9b9667faf560b19509d2c931dd
5
5
  SHA512:
6
- metadata.gz: b4ecb45d3d07efe428b91dc590dfe124488c3b0b2ef459ac8ff141601315c6711fd98b27782bdb2a5a9096de7f42f12ff0f5c7a8fe15ee73d91dc06b3ab4d9d5
7
- data.tar.gz: e23e7e585c11214b3dab625e78a9d935533aff38a27db9bcb27cc442ae3f257057ddec03877b8b832194b6cf12516b8c8bc65174ce92967500b4be488590b45c
6
+ metadata.gz: 23fbf1cbbc8a6940618ce4f4b0883794977dcee6d59446c327be55901734d5ba59125827c54ca5909aa2b9b8f0dd3379cf046148d650a082b02856ea62bb3527
7
+ data.tar.gz: 02166e4ebd4556d1336378ec2dfc707b8b1cd6bfd3e672e63060011f920b8622ddd938324d2c2d4ff8e17b7aafbf2b4075bcae9ec58cbb9cbc3f93cbbda5f7f3
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.21.4 (3/28/2015), [documentation]
7
+ Current tablesorter version: 2.21.5 (4/8/2015), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = '1.16.4'
2
+ VERSION = '1.16.5'
3
3
  end
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 03-30-2015 (v2.21.4)*/
7
+ /*! tablesorter (FORK) - updated 04-08-2015 (v2.21.5)*/
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($) {
18
18
 
19
- /*! TableSorter (FORK) v2.21.4 *//*
19
+ /*! TableSorter (FORK) v2.21.5 *//*
20
20
  * Client-side table sorting with ease!
21
21
  * @requires jQuery v1.2.6+
22
22
  *
@@ -44,7 +44,7 @@
44
44
 
45
45
  var ts = this;
46
46
 
47
- ts.version = '2.21.4';
47
+ ts.version = '2.21.5';
48
48
 
49
49
  ts.parsers = [];
50
50
  ts.widgets = [];
@@ -2861,6 +2861,12 @@ ts.filter = {
2861
2861
  }
2862
2862
  }
2863
2863
  c.$table.find('thead').find('select.' + tscss.filter + '[data-column="' + column + '"]').append(options);
2864
+ txt = wo.filter_selectSource;
2865
+ fxn = $.isFunction(txt) ? true : ts.getColumnData( table, txt, column );
2866
+ if (fxn) {
2867
+ // updating so the extra options are appended
2868
+ ts.filter.buildSelect(c.table, column, '', true, $header.hasClass(wo.filter_onlyAvail));
2869
+ }
2864
2870
  }
2865
2871
  }
2866
2872
  }
@@ -3303,6 +3309,19 @@ ts.filter = {
3303
3309
  $(this).hasClass('filter-parsed');
3304
3310
  }).get();
3305
3311
 
3312
+ // cache filter variables that use ts.getColumnData in the main loop
3313
+ wo.filter_indexed = {
3314
+ functions : [],
3315
+ excludeFilter : [],
3316
+ defaultColFilter : [],
3317
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
3318
+ };
3319
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
3320
+ wo.filter_indexed.functions[ columnIndex ] = ts.getColumnData( table, wo.filter_functions, columnIndex );
3321
+ wo.filter_indexed.defaultColFilter[ columnIndex ] = ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
3322
+ wo.filter_indexed.excludeFilter[ columnIndex ] = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
3323
+ }
3324
+
3306
3325
  if (c.debug) {
3307
3326
  ts.log('Filter: Starting filter widget search', filters);
3308
3327
  time = new Date();
@@ -3389,8 +3408,8 @@ ts.filter = {
3389
3408
  // replace accents
3390
3409
  data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter);
3391
3410
  }
3392
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) {
3393
- data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) );
3411
+ if ( wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultAnyFilter ) ) {
3412
+ data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, wo.filter_indexed.defaultAnyFilter );
3394
3413
  // clear search filtered flag because default filters are not saved to the last search
3395
3414
  searchFiltered = false;
3396
3415
  }
@@ -3472,7 +3491,7 @@ ts.filter = {
3472
3491
  data.index = columnIndex;
3473
3492
 
3474
3493
  // filter types to exclude, per column
3475
- excludeMatch = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
3494
+ excludeMatch = wo.filter_indexed.excludeFilter[ columnIndex ];
3476
3495
 
3477
3496
  // ignore if filter is empty or disabled
3478
3497
  if (data.filter) {
@@ -3497,29 +3516,30 @@ ts.filter = {
3497
3516
  }
3498
3517
 
3499
3518
  val = true;
3500
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) {
3501
- data.filter = ts.filter.defaultFilter( data.filter, ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) );
3519
+ if (wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultColFilter[ columnIndex ] )) {
3520
+ data.filter = ts.filter.defaultFilter( data.filter, wo.filter_indexed.defaultColFilter[ columnIndex ] );
3502
3521
  // val is used to indicate that a filter select is using a default filter; so we override the exact & partial matches
3503
3522
  val = false;
3504
3523
  }
3505
3524
  // data.iFilter = case insensitive (if wo.filter_ignoreCase is true), data.filter = case sensitive
3506
3525
  data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter;
3507
- fxn = ts.getColumnData( table, wo.filter_functions, columnIndex );
3526
+ fxn = wo.filter_indexed.functions[ columnIndex ];
3508
3527
  $cell = c.$headerIndexed[columnIndex];
3509
3528
  hasSelect = $cell.hasClass('filter-select');
3529
+ filterMatched = null;
3510
3530
  if ( fxn || ( hasSelect && val ) ) {
3511
3531
  if (fxn === true || hasSelect) {
3512
3532
  // default selector uses exact match unless "filter-match" class is found
3513
- result = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
3533
+ filterMatched = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
3514
3534
  } else if (typeof fxn === 'function') {
3515
3535
  // filter callback( exact cell content, parser normalized content, filter input value, column index, jQuery row object )
3516
- result = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
3536
+ filterMatched = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
3517
3537
  } else if (typeof fxn[ffxn || data.filter] === 'function') {
3518
3538
  // selector option function
3519
- result = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
3539
+ filterMatched = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
3520
3540
  }
3521
- } else {
3522
- filterMatched = null;
3541
+ }
3542
+ if (filterMatched === null) {
3523
3543
  // cycle through the different filters
3524
3544
  // filters return a boolean or null if nothing matches
3525
3545
  $.each(ts.filter.types, function(type, typeFunction) {
@@ -3538,6 +3558,8 @@ ts.filter = {
3538
3558
  data.exact = (data.iExact + data.childRowText).indexOf( ts.filter.parseFilter(c, data.iFilter, columnIndex, data.parsed[columnIndex]) );
3539
3559
  result = ( (!wo.filter_startsWith && data.exact >= 0) || (wo.filter_startsWith && data.exact === 0) );
3540
3560
  }
3561
+ } else {
3562
+ result = filterMatched;
3541
3563
  }
3542
3564
  showRow = (result) ? showRow : false;
3543
3565
  }
@@ -4095,7 +4117,7 @@ ts.addWidget({
4095
4117
 
4096
4118
  })(jQuery, window);
4097
4119
 
4098
- /*! Widget: resizable - updated 3/26/2015 (v2.21.3) */
4120
+ /*! Widget: resizable - updated 4/2/2015 (v2.21.5) */
4099
4121
  ;(function ($, window) {
4100
4122
  'use strict';
4101
4123
  var ts = $.tablesorter = $.tablesorter || {};
@@ -4186,7 +4208,7 @@ ts.resizable = {
4186
4208
  if ( storedSizes.length ) {
4187
4209
  for ( column = 0; column < c.columns; column++ ) {
4188
4210
  // set saved resizable widths
4189
- c.$headers.eq( column ).width( storedSizes[ column ] );
4211
+ c.$headerIndexed[ column ].width( storedSizes[ column ] );
4190
4212
  if ( $extra.length ) {
4191
4213
  // stickyHeaders needs to modify min & max width as well
4192
4214
  ts.resizable.setWidth( $extra.eq( column ).add( $col.eq( column ) ), storedSizes[ column ] );
@@ -4199,11 +4221,11 @@ ts.resizable = {
4199
4221
  },
4200
4222
 
4201
4223
  setHandlePosition : function( c, wo ) {
4202
- var tableWidth = c.$table.outerWidth(),
4224
+ var startPosition,
4203
4225
  hasScroller = ts.hasWidget( c.table, 'scroller' ),
4204
4226
  tableHeight = c.$table.height(),
4205
4227
  $handles = wo.$resizable_container.children(),
4206
- handleCenter = Math.floor( $handles.width() / 2 - parseFloat( c.$headers.css( 'border-right-width' ) ) * 2 );
4228
+ handleCenter = Math.floor( $handles.width() / 2 );
4207
4229
 
4208
4230
  if ( hasScroller ) {
4209
4231
  tableHeight = 0;
@@ -4213,15 +4235,21 @@ ts.resizable = {
4213
4235
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
4214
4236
  });
4215
4237
  }
4238
+ // subtract out table left position from resizable handles. Fixes #864
4239
+ startPosition = c.$table.position().left;
4216
4240
  $handles.each( function() {
4217
4241
  var $this = $(this),
4218
4242
  column = parseInt( $this.attr( 'data-column' ), 10 ),
4219
4243
  columns = c.columns - 1,
4220
4244
  $header = $this.data( 'header' );
4221
- if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
4245
+ if ( !$header ) { return; } // see #859
4246
+ if ( !$header.is(':visible') ) {
4247
+ $this.hide();
4248
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
4222
4249
  $this.css({
4250
+ display: 'inline-block',
4223
4251
  height : tableHeight,
4224
- left : $header.position().left + $header.width() - handleCenter
4252
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
4225
4253
  });
4226
4254
  }
4227
4255
  });
@@ -4247,7 +4275,7 @@ ts.resizable = {
4247
4275
  var namespace = c.namespace + 'tsresize';
4248
4276
  wo.$resizable_container.children().bind( 'mousedown', function( event ) {
4249
4277
  // save header cell and mouse position
4250
- var column,
4278
+ var column, $this,
4251
4279
  vars = wo.resizable_,
4252
4280
  $extras = $( c.namespace + '_extra_headers' ),
4253
4281
  $header = $( event.target ).data( 'header' );
@@ -4266,7 +4294,11 @@ ts.resizable = {
4266
4294
  vars.next = column;
4267
4295
 
4268
4296
  vars.mouseXPosition = event.pageX;
4269
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
4297
+ vars.storedSizes = [];
4298
+ for ( column = 0; column < c.columns; column++ ) {
4299
+ $this = c.$headerIndexed[ column ];
4300
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
4301
+ }
4270
4302
  ts.resizable.toggleTextSelection( c, true );
4271
4303
  });
4272
4304
 
@@ -4297,15 +4329,20 @@ ts.resizable = {
4297
4329
  });
4298
4330
 
4299
4331
  // right click to reset columns to default widths
4300
- c.$table.find( 'thead:first' ).add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
4301
- .bind( 'contextmenu' + namespace, function() {
4302
- // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
4303
- var allowClick = wo.resizable_.storedSizes.length === 0;
4304
- ts.resizableReset( c.table );
4305
- ts.resizable.setHandlePosition( c, wo );
4306
- wo.resizable_.storedSizes = [];
4307
- return allowClick;
4308
- });
4332
+ c.$table
4333
+ .bind( 'columnUpdate' + namespace, function() {
4334
+ ts.resizable.setHandlePosition( c, wo );
4335
+ })
4336
+ .find( 'thead:first' )
4337
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
4338
+ .bind( 'contextmenu' + namespace, function() {
4339
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
4340
+ var allowClick = wo.resizable_.storedSizes.length === 0;
4341
+ ts.resizableReset( c.table );
4342
+ ts.resizable.setHandlePosition( c, wo );
4343
+ wo.resizable_.storedSizes = [];
4344
+ return allowClick;
4345
+ });
4309
4346
 
4310
4347
  },
4311
4348
 
@@ -4313,10 +4350,8 @@ ts.resizable = {
4313
4350
  if ( wo.resizable_.mouseXPosition === 0 || !wo.resizable_.$target ) { return; }
4314
4351
  // resize columns
4315
4352
  var vars = wo.resizable_,
4316
- $target = vars.$target,
4317
4353
  $next = vars.$next,
4318
- leftEdge = event.pageX - vars.mouseXPosition,
4319
- targetWidth = $target.width();
4354
+ leftEdge = event.pageX - vars.mouseXPosition;
4320
4355
  if ( vars.fullWidth ) {
4321
4356
  vars.storedSizes[ vars.target ] += leftEdge;
4322
4357
  vars.storedSizes[ vars.next ] -= leftEdge;
@@ -4338,10 +4373,15 @@ ts.resizable = {
4338
4373
  },
4339
4374
 
4340
4375
  stopResize : function( c, wo ) {
4341
- var vars = wo.resizable_;
4376
+ var $this, column,
4377
+ vars = wo.resizable_;
4342
4378
  vars.storedSizes = [];
4343
4379
  if ( ts.storage ) {
4344
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
4380
+ vars.storedSizes = [];
4381
+ for ( column = 0; column < c.columns; column++ ) {
4382
+ $this = c.$headerIndexed[ column ];
4383
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
4384
+ }
4345
4385
  if ( wo.resizable !== false ) {
4346
4386
  // save all column widths
4347
4387
  ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
@@ -4386,19 +4426,19 @@ ts.addWidget({
4386
4426
 
4387
4427
  ts.resizableReset = function( table, nosave ) {
4388
4428
  $( table ).each(function(){
4389
- var $t,
4429
+ var index, $t,
4390
4430
  c = this.config,
4391
4431
  wo = c && c.widgetOptions;
4392
- if ( table && c ) {
4393
- c.$headers.each( function( i ) {
4394
- $t = $(this);
4395
- if ( wo.resizable_widths && wo.resizable_widths[ i ] ) {
4396
- $t.css( 'width', wo.resizable_widths[ i ] );
4432
+ if ( table && c && c.$headerIndexed.length ) {
4433
+ for ( index = 0; index < c.columns; index++ ) {
4434
+ $t = c.$headerIndexed[ index ];
4435
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
4436
+ $t.css( 'width', wo.resizable_widths[ index ] );
4397
4437
  } else if ( !$t.hasClass( 'resizable-false' ) ) {
4398
4438
  // don't clear the width of any column that is not resizable
4399
4439
  $t.css( 'width', '' );
4400
4440
  }
4401
- });
4441
+ }
4402
4442
  // reset stickyHeader widths
4403
4443
  $( window ).trigger( 'resize' );
4404
4444
  if ( ts.storage && !nosave ) {
@@ -1,4 +1,4 @@
1
- /*! TableSorter (FORK) v2.21.4 *//*
1
+ /*! TableSorter (FORK) v2.21.5 *//*
2
2
  * Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
@@ -26,7 +26,7 @@
26
26
 
27
27
  var ts = this;
28
28
 
29
- ts.version = '2.21.4';
29
+ ts.version = '2.21.5';
30
30
 
31
31
  ts.parsers = [];
32
32
  ts.widgets = [];
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 03-30-2015 (v2.21.4)*/
7
+ /*! tablesorter (FORK) - updated 04-08-2015 (v2.21.5)*/
8
8
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -732,6 +732,12 @@ ts.filter = {
732
732
  }
733
733
  }
734
734
  c.$table.find('thead').find('select.' + tscss.filter + '[data-column="' + column + '"]').append(options);
735
+ txt = wo.filter_selectSource;
736
+ fxn = $.isFunction(txt) ? true : ts.getColumnData( table, txt, column );
737
+ if (fxn) {
738
+ // updating so the extra options are appended
739
+ ts.filter.buildSelect(c.table, column, '', true, $header.hasClass(wo.filter_onlyAvail));
740
+ }
735
741
  }
736
742
  }
737
743
  }
@@ -1174,6 +1180,19 @@ ts.filter = {
1174
1180
  $(this).hasClass('filter-parsed');
1175
1181
  }).get();
1176
1182
 
1183
+ // cache filter variables that use ts.getColumnData in the main loop
1184
+ wo.filter_indexed = {
1185
+ functions : [],
1186
+ excludeFilter : [],
1187
+ defaultColFilter : [],
1188
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
1189
+ };
1190
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
1191
+ wo.filter_indexed.functions[ columnIndex ] = ts.getColumnData( table, wo.filter_functions, columnIndex );
1192
+ wo.filter_indexed.defaultColFilter[ columnIndex ] = ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
1193
+ wo.filter_indexed.excludeFilter[ columnIndex ] = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
1194
+ }
1195
+
1177
1196
  if (c.debug) {
1178
1197
  ts.log('Filter: Starting filter widget search', filters);
1179
1198
  time = new Date();
@@ -1260,8 +1279,8 @@ ts.filter = {
1260
1279
  // replace accents
1261
1280
  data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter);
1262
1281
  }
1263
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) {
1264
- data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) );
1282
+ if ( wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultAnyFilter ) ) {
1283
+ data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, wo.filter_indexed.defaultAnyFilter );
1265
1284
  // clear search filtered flag because default filters are not saved to the last search
1266
1285
  searchFiltered = false;
1267
1286
  }
@@ -1343,7 +1362,7 @@ ts.filter = {
1343
1362
  data.index = columnIndex;
1344
1363
 
1345
1364
  // filter types to exclude, per column
1346
- excludeMatch = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
1365
+ excludeMatch = wo.filter_indexed.excludeFilter[ columnIndex ];
1347
1366
 
1348
1367
  // ignore if filter is empty or disabled
1349
1368
  if (data.filter) {
@@ -1368,29 +1387,30 @@ ts.filter = {
1368
1387
  }
1369
1388
 
1370
1389
  val = true;
1371
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) {
1372
- data.filter = ts.filter.defaultFilter( data.filter, ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) );
1390
+ if (wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultColFilter[ columnIndex ] )) {
1391
+ data.filter = ts.filter.defaultFilter( data.filter, wo.filter_indexed.defaultColFilter[ columnIndex ] );
1373
1392
  // val is used to indicate that a filter select is using a default filter; so we override the exact & partial matches
1374
1393
  val = false;
1375
1394
  }
1376
1395
  // data.iFilter = case insensitive (if wo.filter_ignoreCase is true), data.filter = case sensitive
1377
1396
  data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter;
1378
- fxn = ts.getColumnData( table, wo.filter_functions, columnIndex );
1397
+ fxn = wo.filter_indexed.functions[ columnIndex ];
1379
1398
  $cell = c.$headerIndexed[columnIndex];
1380
1399
  hasSelect = $cell.hasClass('filter-select');
1400
+ filterMatched = null;
1381
1401
  if ( fxn || ( hasSelect && val ) ) {
1382
1402
  if (fxn === true || hasSelect) {
1383
1403
  // default selector uses exact match unless "filter-match" class is found
1384
- result = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
1404
+ filterMatched = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
1385
1405
  } else if (typeof fxn === 'function') {
1386
1406
  // filter callback( exact cell content, parser normalized content, filter input value, column index, jQuery row object )
1387
- result = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1407
+ filterMatched = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1388
1408
  } else if (typeof fxn[ffxn || data.filter] === 'function') {
1389
1409
  // selector option function
1390
- result = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1410
+ filterMatched = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1391
1411
  }
1392
- } else {
1393
- filterMatched = null;
1412
+ }
1413
+ if (filterMatched === null) {
1394
1414
  // cycle through the different filters
1395
1415
  // filters return a boolean or null if nothing matches
1396
1416
  $.each(ts.filter.types, function(type, typeFunction) {
@@ -1409,6 +1429,8 @@ ts.filter = {
1409
1429
  data.exact = (data.iExact + data.childRowText).indexOf( ts.filter.parseFilter(c, data.iFilter, columnIndex, data.parsed[columnIndex]) );
1410
1430
  result = ( (!wo.filter_startsWith && data.exact >= 0) || (wo.filter_startsWith && data.exact === 0) );
1411
1431
  }
1432
+ } else {
1433
+ result = filterMatched;
1412
1434
  }
1413
1435
  showRow = (result) ? showRow : false;
1414
1436
  }
@@ -1966,7 +1988,7 @@ ts.addWidget({
1966
1988
 
1967
1989
  })(jQuery, window);
1968
1990
 
1969
- /*! Widget: resizable - updated 3/26/2015 (v2.21.3) */
1991
+ /*! Widget: resizable - updated 4/2/2015 (v2.21.5) */
1970
1992
  ;(function ($, window) {
1971
1993
  'use strict';
1972
1994
  var ts = $.tablesorter = $.tablesorter || {};
@@ -2057,7 +2079,7 @@ ts.resizable = {
2057
2079
  if ( storedSizes.length ) {
2058
2080
  for ( column = 0; column < c.columns; column++ ) {
2059
2081
  // set saved resizable widths
2060
- c.$headers.eq( column ).width( storedSizes[ column ] );
2082
+ c.$headerIndexed[ column ].width( storedSizes[ column ] );
2061
2083
  if ( $extra.length ) {
2062
2084
  // stickyHeaders needs to modify min & max width as well
2063
2085
  ts.resizable.setWidth( $extra.eq( column ).add( $col.eq( column ) ), storedSizes[ column ] );
@@ -2070,11 +2092,11 @@ ts.resizable = {
2070
2092
  },
2071
2093
 
2072
2094
  setHandlePosition : function( c, wo ) {
2073
- var tableWidth = c.$table.outerWidth(),
2095
+ var startPosition,
2074
2096
  hasScroller = ts.hasWidget( c.table, 'scroller' ),
2075
2097
  tableHeight = c.$table.height(),
2076
2098
  $handles = wo.$resizable_container.children(),
2077
- handleCenter = Math.floor( $handles.width() / 2 - parseFloat( c.$headers.css( 'border-right-width' ) ) * 2 );
2099
+ handleCenter = Math.floor( $handles.width() / 2 );
2078
2100
 
2079
2101
  if ( hasScroller ) {
2080
2102
  tableHeight = 0;
@@ -2084,15 +2106,21 @@ ts.resizable = {
2084
2106
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
2085
2107
  });
2086
2108
  }
2109
+ // subtract out table left position from resizable handles. Fixes #864
2110
+ startPosition = c.$table.position().left;
2087
2111
  $handles.each( function() {
2088
2112
  var $this = $(this),
2089
2113
  column = parseInt( $this.attr( 'data-column' ), 10 ),
2090
2114
  columns = c.columns - 1,
2091
2115
  $header = $this.data( 'header' );
2092
- if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
2116
+ if ( !$header ) { return; } // see #859
2117
+ if ( !$header.is(':visible') ) {
2118
+ $this.hide();
2119
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
2093
2120
  $this.css({
2121
+ display: 'inline-block',
2094
2122
  height : tableHeight,
2095
- left : $header.position().left + $header.width() - handleCenter
2123
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
2096
2124
  });
2097
2125
  }
2098
2126
  });
@@ -2118,7 +2146,7 @@ ts.resizable = {
2118
2146
  var namespace = c.namespace + 'tsresize';
2119
2147
  wo.$resizable_container.children().bind( 'mousedown', function( event ) {
2120
2148
  // save header cell and mouse position
2121
- var column,
2149
+ var column, $this,
2122
2150
  vars = wo.resizable_,
2123
2151
  $extras = $( c.namespace + '_extra_headers' ),
2124
2152
  $header = $( event.target ).data( 'header' );
@@ -2137,7 +2165,11 @@ ts.resizable = {
2137
2165
  vars.next = column;
2138
2166
 
2139
2167
  vars.mouseXPosition = event.pageX;
2140
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
2168
+ vars.storedSizes = [];
2169
+ for ( column = 0; column < c.columns; column++ ) {
2170
+ $this = c.$headerIndexed[ column ];
2171
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
2172
+ }
2141
2173
  ts.resizable.toggleTextSelection( c, true );
2142
2174
  });
2143
2175
 
@@ -2168,15 +2200,20 @@ ts.resizable = {
2168
2200
  });
2169
2201
 
2170
2202
  // right click to reset columns to default widths
2171
- c.$table.find( 'thead:first' ).add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
2172
- .bind( 'contextmenu' + namespace, function() {
2173
- // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
2174
- var allowClick = wo.resizable_.storedSizes.length === 0;
2175
- ts.resizableReset( c.table );
2176
- ts.resizable.setHandlePosition( c, wo );
2177
- wo.resizable_.storedSizes = [];
2178
- return allowClick;
2179
- });
2203
+ c.$table
2204
+ .bind( 'columnUpdate' + namespace, function() {
2205
+ ts.resizable.setHandlePosition( c, wo );
2206
+ })
2207
+ .find( 'thead:first' )
2208
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
2209
+ .bind( 'contextmenu' + namespace, function() {
2210
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
2211
+ var allowClick = wo.resizable_.storedSizes.length === 0;
2212
+ ts.resizableReset( c.table );
2213
+ ts.resizable.setHandlePosition( c, wo );
2214
+ wo.resizable_.storedSizes = [];
2215
+ return allowClick;
2216
+ });
2180
2217
 
2181
2218
  },
2182
2219
 
@@ -2184,10 +2221,8 @@ ts.resizable = {
2184
2221
  if ( wo.resizable_.mouseXPosition === 0 || !wo.resizable_.$target ) { return; }
2185
2222
  // resize columns
2186
2223
  var vars = wo.resizable_,
2187
- $target = vars.$target,
2188
2224
  $next = vars.$next,
2189
- leftEdge = event.pageX - vars.mouseXPosition,
2190
- targetWidth = $target.width();
2225
+ leftEdge = event.pageX - vars.mouseXPosition;
2191
2226
  if ( vars.fullWidth ) {
2192
2227
  vars.storedSizes[ vars.target ] += leftEdge;
2193
2228
  vars.storedSizes[ vars.next ] -= leftEdge;
@@ -2209,10 +2244,15 @@ ts.resizable = {
2209
2244
  },
2210
2245
 
2211
2246
  stopResize : function( c, wo ) {
2212
- var vars = wo.resizable_;
2247
+ var $this, column,
2248
+ vars = wo.resizable_;
2213
2249
  vars.storedSizes = [];
2214
2250
  if ( ts.storage ) {
2215
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
2251
+ vars.storedSizes = [];
2252
+ for ( column = 0; column < c.columns; column++ ) {
2253
+ $this = c.$headerIndexed[ column ];
2254
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
2255
+ }
2216
2256
  if ( wo.resizable !== false ) {
2217
2257
  // save all column widths
2218
2258
  ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
@@ -2257,19 +2297,19 @@ ts.addWidget({
2257
2297
 
2258
2298
  ts.resizableReset = function( table, nosave ) {
2259
2299
  $( table ).each(function(){
2260
- var $t,
2300
+ var index, $t,
2261
2301
  c = this.config,
2262
2302
  wo = c && c.widgetOptions;
2263
- if ( table && c ) {
2264
- c.$headers.each( function( i ) {
2265
- $t = $(this);
2266
- if ( wo.resizable_widths && wo.resizable_widths[ i ] ) {
2267
- $t.css( 'width', wo.resizable_widths[ i ] );
2303
+ if ( table && c && c.$headerIndexed.length ) {
2304
+ for ( index = 0; index < c.columns; index++ ) {
2305
+ $t = c.$headerIndexed[ index ];
2306
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
2307
+ $t.css( 'width', wo.resizable_widths[ index ] );
2268
2308
  } else if ( !$t.hasClass( 'resizable-false' ) ) {
2269
2309
  // don't clear the width of any column that is not resizable
2270
2310
  $t.css( 'width', '' );
2271
2311
  }
2272
- });
2312
+ }
2273
2313
  // reset stickyHeader widths
2274
2314
  $( window ).trigger( 'resize' );
2275
2315
  if ( ts.storage && !nosave ) {
@@ -359,6 +359,12 @@ ts.filter = {
359
359
  }
360
360
  }
361
361
  c.$table.find('thead').find('select.' + tscss.filter + '[data-column="' + column + '"]').append(options);
362
+ txt = wo.filter_selectSource;
363
+ fxn = $.isFunction(txt) ? true : ts.getColumnData( table, txt, column );
364
+ if (fxn) {
365
+ // updating so the extra options are appended
366
+ ts.filter.buildSelect(c.table, column, '', true, $header.hasClass(wo.filter_onlyAvail));
367
+ }
362
368
  }
363
369
  }
364
370
  }
@@ -801,6 +807,19 @@ ts.filter = {
801
807
  $(this).hasClass('filter-parsed');
802
808
  }).get();
803
809
 
810
+ // cache filter variables that use ts.getColumnData in the main loop
811
+ wo.filter_indexed = {
812
+ functions : [],
813
+ excludeFilter : [],
814
+ defaultColFilter : [],
815
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
816
+ };
817
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
818
+ wo.filter_indexed.functions[ columnIndex ] = ts.getColumnData( table, wo.filter_functions, columnIndex );
819
+ wo.filter_indexed.defaultColFilter[ columnIndex ] = ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
820
+ wo.filter_indexed.excludeFilter[ columnIndex ] = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
821
+ }
822
+
804
823
  if (c.debug) {
805
824
  ts.log('Filter: Starting filter widget search', filters);
806
825
  time = new Date();
@@ -887,8 +906,8 @@ ts.filter = {
887
906
  // replace accents
888
907
  data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter);
889
908
  }
890
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) {
891
- data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) );
909
+ if ( wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultAnyFilter ) ) {
910
+ data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, wo.filter_indexed.defaultAnyFilter );
892
911
  // clear search filtered flag because default filters are not saved to the last search
893
912
  searchFiltered = false;
894
913
  }
@@ -970,7 +989,7 @@ ts.filter = {
970
989
  data.index = columnIndex;
971
990
 
972
991
  // filter types to exclude, per column
973
- excludeMatch = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/);
992
+ excludeMatch = wo.filter_indexed.excludeFilter[ columnIndex ];
974
993
 
975
994
  // ignore if filter is empty or disabled
976
995
  if (data.filter) {
@@ -995,29 +1014,30 @@ ts.filter = {
995
1014
  }
996
1015
 
997
1016
  val = true;
998
- if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) {
999
- data.filter = ts.filter.defaultFilter( data.filter, ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) );
1017
+ if (wo.filter_defaultFilter && regex.iQuery.test( wo.filter_indexed.defaultColFilter[ columnIndex ] )) {
1018
+ data.filter = ts.filter.defaultFilter( data.filter, wo.filter_indexed.defaultColFilter[ columnIndex ] );
1000
1019
  // val is used to indicate that a filter select is using a default filter; so we override the exact & partial matches
1001
1020
  val = false;
1002
1021
  }
1003
1022
  // data.iFilter = case insensitive (if wo.filter_ignoreCase is true), data.filter = case sensitive
1004
1023
  data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter;
1005
- fxn = ts.getColumnData( table, wo.filter_functions, columnIndex );
1024
+ fxn = wo.filter_indexed.functions[ columnIndex ];
1006
1025
  $cell = c.$headerIndexed[columnIndex];
1007
1026
  hasSelect = $cell.hasClass('filter-select');
1027
+ filterMatched = null;
1008
1028
  if ( fxn || ( hasSelect && val ) ) {
1009
1029
  if (fxn === true || hasSelect) {
1010
1030
  // default selector uses exact match unless "filter-match" class is found
1011
- result = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
1031
+ filterMatched = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact;
1012
1032
  } else if (typeof fxn === 'function') {
1013
1033
  // filter callback( exact cell content, parser normalized content, filter input value, column index, jQuery row object )
1014
- result = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1034
+ filterMatched = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1015
1035
  } else if (typeof fxn[ffxn || data.filter] === 'function') {
1016
1036
  // selector option function
1017
- result = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1037
+ filterMatched = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex), c);
1018
1038
  }
1019
- } else {
1020
- filterMatched = null;
1039
+ }
1040
+ if (filterMatched === null) {
1021
1041
  // cycle through the different filters
1022
1042
  // filters return a boolean or null if nothing matches
1023
1043
  $.each(ts.filter.types, function(type, typeFunction) {
@@ -1036,6 +1056,8 @@ ts.filter = {
1036
1056
  data.exact = (data.iExact + data.childRowText).indexOf( ts.filter.parseFilter(c, data.iFilter, columnIndex, data.parsed[columnIndex]) );
1037
1057
  result = ( (!wo.filter_startsWith && data.exact >= 0) || (wo.filter_startsWith && data.exact === 0) );
1038
1058
  }
1059
+ } else {
1060
+ result = filterMatched;
1039
1061
  }
1040
1062
  showRow = (result) ? showRow : false;
1041
1063
  }
@@ -1,4 +1,4 @@
1
- /*! Widget: resizable - updated 3/26/2015 (v2.21.3) */
1
+ /*! Widget: resizable - updated 4/2/2015 (v2.21.5) */
2
2
  ;(function ($, window) {
3
3
  'use strict';
4
4
  var ts = $.tablesorter = $.tablesorter || {};
@@ -89,7 +89,7 @@ ts.resizable = {
89
89
  if ( storedSizes.length ) {
90
90
  for ( column = 0; column < c.columns; column++ ) {
91
91
  // set saved resizable widths
92
- c.$headers.eq( column ).width( storedSizes[ column ] );
92
+ c.$headerIndexed[ column ].width( storedSizes[ column ] );
93
93
  if ( $extra.length ) {
94
94
  // stickyHeaders needs to modify min & max width as well
95
95
  ts.resizable.setWidth( $extra.eq( column ).add( $col.eq( column ) ), storedSizes[ column ] );
@@ -102,11 +102,11 @@ ts.resizable = {
102
102
  },
103
103
 
104
104
  setHandlePosition : function( c, wo ) {
105
- var tableWidth = c.$table.outerWidth(),
105
+ var startPosition,
106
106
  hasScroller = ts.hasWidget( c.table, 'scroller' ),
107
107
  tableHeight = c.$table.height(),
108
108
  $handles = wo.$resizable_container.children(),
109
- handleCenter = Math.floor( $handles.width() / 2 - parseFloat( c.$headers.css( 'border-right-width' ) ) * 2 );
109
+ handleCenter = Math.floor( $handles.width() / 2 );
110
110
 
111
111
  if ( hasScroller ) {
112
112
  tableHeight = 0;
@@ -116,15 +116,21 @@ ts.resizable = {
116
116
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
117
117
  });
118
118
  }
119
+ // subtract out table left position from resizable handles. Fixes #864
120
+ startPosition = c.$table.position().left;
119
121
  $handles.each( function() {
120
122
  var $this = $(this),
121
123
  column = parseInt( $this.attr( 'data-column' ), 10 ),
122
124
  columns = c.columns - 1,
123
125
  $header = $this.data( 'header' );
124
- if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
126
+ if ( !$header ) { return; } // see #859
127
+ if ( !$header.is(':visible') ) {
128
+ $this.hide();
129
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
125
130
  $this.css({
131
+ display: 'inline-block',
126
132
  height : tableHeight,
127
- left : $header.position().left + $header.width() - handleCenter
133
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
128
134
  });
129
135
  }
130
136
  });
@@ -150,7 +156,7 @@ ts.resizable = {
150
156
  var namespace = c.namespace + 'tsresize';
151
157
  wo.$resizable_container.children().bind( 'mousedown', function( event ) {
152
158
  // save header cell and mouse position
153
- var column,
159
+ var column, $this,
154
160
  vars = wo.resizable_,
155
161
  $extras = $( c.namespace + '_extra_headers' ),
156
162
  $header = $( event.target ).data( 'header' );
@@ -169,7 +175,11 @@ ts.resizable = {
169
175
  vars.next = column;
170
176
 
171
177
  vars.mouseXPosition = event.pageX;
172
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
178
+ vars.storedSizes = [];
179
+ for ( column = 0; column < c.columns; column++ ) {
180
+ $this = c.$headerIndexed[ column ];
181
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
182
+ }
173
183
  ts.resizable.toggleTextSelection( c, true );
174
184
  });
175
185
 
@@ -200,15 +210,20 @@ ts.resizable = {
200
210
  });
201
211
 
202
212
  // right click to reset columns to default widths
203
- c.$table.find( 'thead:first' ).add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
204
- .bind( 'contextmenu' + namespace, function() {
205
- // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
206
- var allowClick = wo.resizable_.storedSizes.length === 0;
207
- ts.resizableReset( c.table );
208
- ts.resizable.setHandlePosition( c, wo );
209
- wo.resizable_.storedSizes = [];
210
- return allowClick;
211
- });
213
+ c.$table
214
+ .bind( 'columnUpdate' + namespace, function() {
215
+ ts.resizable.setHandlePosition( c, wo );
216
+ })
217
+ .find( 'thead:first' )
218
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
219
+ .bind( 'contextmenu' + namespace, function() {
220
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
221
+ var allowClick = wo.resizable_.storedSizes.length === 0;
222
+ ts.resizableReset( c.table );
223
+ ts.resizable.setHandlePosition( c, wo );
224
+ wo.resizable_.storedSizes = [];
225
+ return allowClick;
226
+ });
212
227
 
213
228
  },
214
229
 
@@ -216,10 +231,8 @@ ts.resizable = {
216
231
  if ( wo.resizable_.mouseXPosition === 0 || !wo.resizable_.$target ) { return; }
217
232
  // resize columns
218
233
  var vars = wo.resizable_,
219
- $target = vars.$target,
220
234
  $next = vars.$next,
221
- leftEdge = event.pageX - vars.mouseXPosition,
222
- targetWidth = $target.width();
235
+ leftEdge = event.pageX - vars.mouseXPosition;
223
236
  if ( vars.fullWidth ) {
224
237
  vars.storedSizes[ vars.target ] += leftEdge;
225
238
  vars.storedSizes[ vars.next ] -= leftEdge;
@@ -241,10 +254,15 @@ ts.resizable = {
241
254
  },
242
255
 
243
256
  stopResize : function( c, wo ) {
244
- var vars = wo.resizable_;
257
+ var $this, column,
258
+ vars = wo.resizable_;
245
259
  vars.storedSizes = [];
246
260
  if ( ts.storage ) {
247
- vars.storedSizes = c.$headers.map(function(){ return $(this).width(); }).get();
261
+ vars.storedSizes = [];
262
+ for ( column = 0; column < c.columns; column++ ) {
263
+ $this = c.$headerIndexed[ column ];
264
+ vars.storedSizes[ column ] = $this.is(':visible') ? $this.width() : 0;
265
+ }
248
266
  if ( wo.resizable !== false ) {
249
267
  // save all column widths
250
268
  ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
@@ -289,19 +307,19 @@ ts.addWidget({
289
307
 
290
308
  ts.resizableReset = function( table, nosave ) {
291
309
  $( table ).each(function(){
292
- var $t,
310
+ var index, $t,
293
311
  c = this.config,
294
312
  wo = c && c.widgetOptions;
295
- if ( table && c ) {
296
- c.$headers.each( function( i ) {
297
- $t = $(this);
298
- if ( wo.resizable_widths && wo.resizable_widths[ i ] ) {
299
- $t.css( 'width', wo.resizable_widths[ i ] );
313
+ if ( table && c && c.$headerIndexed.length ) {
314
+ for ( index = 0; index < c.columns; index++ ) {
315
+ $t = c.$headerIndexed[ index ];
316
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
317
+ $t.css( 'width', wo.resizable_widths[ index ] );
300
318
  } else if ( !$t.hasClass( 'resizable-false' ) ) {
301
319
  // don't clear the width of any column that is not resizable
302
320
  $t.css( 'width', '' );
303
321
  }
304
- });
322
+ }
305
323
  // reset stickyHeader widths
306
324
  $( window ).trigger( 'resize' );
307
325
  if ( ts.storage && !nosave ) {
@@ -1,4 +1,4 @@
1
- /*! Widget: scroller - updated 3/26/2015 (v2.21.3) *//*
1
+ /*! Widget: scroller - updated 4/2/2015 (v2.21.5) *//*
2
2
  Copyright (C) 2011 T. Connell & Associates, Inc.
3
3
 
4
4
  Dual-licensed under the MIT and GPL licenses
@@ -434,7 +434,7 @@ ts.scroller = {
434
434
  ts.bindEvents( c.table, $fixedColumn.find( '.' + tscss.header ) );
435
435
 
436
436
  // update thead & tbody in fixed column
437
- temp = ( 'sortEnd filterEnd ' ).split( ' ' ).join( namespace + ' ' );
437
+ temp = ( 'tablesorter-initialized sortEnd filterEnd ' ).split( ' ' ).join( namespace + ' ' );
438
438
  c.$table
439
439
  .off( temp )
440
440
  .on( temp, function( event, size ) {
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.16.4
4
+ version: 1.16.5
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-03-30 00:00:00.000000000 Z
12
+ date: 2015-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties