jquery-tablesorter 1.10.7 → 1.10.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/Rakefile +20 -30
  4. data/lib/jquery-tablesorter.rb +1 -1
  5. data/lib/jquery-tablesorter/version.rb +1 -1
  6. data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +20 -4
  7. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +15 -10
  8. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +27 -13
  9. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +7 -7
  10. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +20 -5
  11. data/vendor/assets/stylesheets/jquery-tablesorter/theme.black-ice.css +4 -0
  12. data/vendor/assets/stylesheets/jquery-tablesorter/theme.blue.css +4 -0
  13. data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap.css +4 -0
  14. data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap_2.css +4 -0
  15. data/vendor/assets/stylesheets/jquery-tablesorter/theme.dark.css +4 -0
  16. data/vendor/assets/stylesheets/jquery-tablesorter/theme.default.css +4 -0
  17. data/vendor/assets/stylesheets/jquery-tablesorter/theme.dropbox.css +4 -0
  18. data/vendor/assets/stylesheets/jquery-tablesorter/theme.green.css +4 -0
  19. data/vendor/assets/stylesheets/jquery-tablesorter/theme.grey.css +4 -0
  20. data/vendor/assets/stylesheets/jquery-tablesorter/theme.ice.css +4 -0
  21. data/vendor/assets/stylesheets/jquery-tablesorter/theme.jui.css +4 -0
  22. metadata +2 -10
  23. data/vendor/assets/images/jquery-tablesorter/dropbox-asc1.png +0 -0
  24. data/vendor/assets/images/jquery-tablesorter/dropbox-asc2.png +0 -0
  25. data/vendor/assets/images/jquery-tablesorter/dropbox-desc1.png +0 -0
  26. data/vendor/assets/images/jquery-tablesorter/dropbox-desc2.png +0 -0
  27. data/vendor/assets/images/jquery-tablesorter/green-asc.png +0 -0
  28. data/vendor/assets/images/jquery-tablesorter/green-desc.png +0 -0
  29. data/vendor/assets/images/jquery-tablesorter/green-header.png +0 -0
  30. data/vendor/assets/images/jquery-tablesorter/green-unsorted.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5130db03709c4bc71cd6478decaef113fc7f3474
4
- data.tar.gz: 55da5bc1ddff917278abda02f4c4a9f5989e864c
3
+ metadata.gz: ffc506ef591e1d7e8f5274e6058dfb43a6b9f7b9
4
+ data.tar.gz: 126d7677c03b8a8f2905b0fd2accbbd0c01645e6
5
5
  SHA512:
6
- metadata.gz: 7d87ee353472c3ddc5a136c5bdb3cc0c6fcb32c0e28c2e7628d8d55153e41893e6d58d62b2160e8f7ce929e64e94bb34bb073e4f7a388275aac0a733cb498460
7
- data.tar.gz: 9b074256f38d0874253d8a3ada75d643011eb71627f2e5938b7a495e58b1369c2480d9dbd0f86f8979698105ae2dcbf3b5becae2dde939485fbdde77faa197ac
6
+ metadata.gz: cf473da52e37a4960a477aa9bccee11c1f5c6b43a5df212e7af16e5eca97dd73a11aaed29651c01407605b81435a380174f83cd31fa6a6540c0905b32723f7f6
7
+ data.tar.gz: 7f4c0f0c095bf9e29973d455d713a8356fa6888464bd7f5a70ec7f73423daf3be3977b3b65d8d220bfd2c17512f1ba8744d8e2507d7e4fc84bc31cb0b2099579
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.15.11 (3/18/2014), [documentation]
7
+ Current tablesorter version: 2.15.12 (3/31/2014), [documentation]
8
8
 
9
9
  Any issue associate with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -38,7 +38,7 @@ In your `application.js`
38
38
  //= require jquery-tablesorter
39
39
  ```
40
40
 
41
- This will require all jquery-tablesorter files (excluding addons, widgets, ...).
41
+ This will require all jquery-tablesorter files (excluding addons and extras).
42
42
 
43
43
  Or you can include single file with:
44
44
 
data/Rakefile CHANGED
@@ -11,60 +11,50 @@ namespace :jquery_tablesorter do
11
11
  # javascripts
12
12
  #
13
13
  javascript_dir = File.join('vendor', 'assets', 'javascripts', 'jquery-tablesorter')
14
- FileUtils.mkdir_p(javascript_dir)
15
- Dir.glob(File.join('tablesorter', 'js', '*.js')).reject{|file| file =~ /.min.js\Z/}.each do |file|
16
- FileUtils.cp file, javascript_dir, :verbose => true
17
- end
14
+ copy_files(Dir.glob(File.join('tablesorter', 'js', '*.js')).reject{|file| file =~ /.min.js\Z/}, javascript_dir)
18
15
 
19
16
  # stylesheets
20
17
  #
21
18
  stylesheet_dir = File.join('vendor', 'assets', 'stylesheets', 'jquery-tablesorter')
22
- FileUtils.mkdir_p(stylesheet_dir)
23
- Dir.glob(File.join('tablesorter', 'css', '*.css')).each do |file|
24
- FileUtils.cp file, stylesheet_dir, :verbose => true
25
- end
19
+ copy_files(Dir.glob(File.join('tablesorter', 'css', '*.css')), stylesheet_dir)
26
20
 
27
21
  # images
28
22
  #
29
23
  images_dir = File.join('vendor', 'assets', 'images', 'jquery-tablesorter')
30
- FileUtils.mkdir_p(images_dir)
31
- Dir.glob(File.join('tablesorter', 'css', 'images', '*')).each do |file|
32
- FileUtils.cp file, images_dir, :verbose => true
33
- end
24
+ copy_files(Dir.glob(File.join('tablesorter', 'css', 'images', '*')), images_dir)
34
25
 
35
26
  # addons
36
27
  #
37
28
  ## pager
38
- pager_stylesheet_dir = File.join(stylesheet_dir, 'addons', 'pager')
39
- FileUtils.mkdir_p(pager_stylesheet_dir)
40
- FileUtils.cp File.join('tablesorter', 'addons', 'pager', 'jquery.tablesorter.pager.css'),
41
- pager_stylesheet_dir,
42
- :verbose => true
29
+ pager_stylesheet_dir = File.join(stylesheet_dir, 'addons', 'pager')
30
+ copy_files([File.join('tablesorter', 'addons', 'pager', 'jquery.tablesorter.pager.css')], pager_stylesheet_dir)
43
31
 
44
32
  pager_javascript_dir = File.join(javascript_dir, 'addons', 'pager')
45
- FileUtils.mkdir_p(pager_javascript_dir)
46
- FileUtils.cp File.join('tablesorter', 'addons', 'pager', 'jquery.tablesorter.pager.js'),
47
- pager_javascript_dir,
48
- :verbose => true
33
+ copy_files([File.join('tablesorter', 'addons', 'pager', 'jquery.tablesorter.pager.js')], pager_javascript_dir)
49
34
 
50
- pager_images_dir = File.join(images_dir, 'addons', 'pager')
51
- FileUtils.mkdir_p(pager_images_dir)
52
- FileUtils.cp_r File.join('tablesorter', 'addons', 'pager', 'icons'), pager_images_dir,
53
- :verbose => true
35
+ pager_images_dir = File.join(images_dir, 'addons', 'pager', 'icons')
36
+ copy_files(Dir.glob(File.join('tablesorter', 'addons', 'pager', 'icons', '*')), pager_images_dir)
54
37
 
55
38
 
56
- # parsers and widgets
39
+ # parsers, widgets and extras
57
40
  #
58
41
  %w(parsers widgets extras).each do |folder|
59
42
  folder_javascript_dir = File.join(javascript_dir, folder)
60
- FileUtils.mkdir_p(folder_javascript_dir)
61
- Dir.glob(File.join('tablesorter', 'js', folder, '*.js')).reject{|file| file =~ /.min.js\Z/}.each do |file|
62
- FileUtils.cp file, folder_javascript_dir, :verbose => true
63
- end
43
+ files = Dir.glob(File.join('tablesorter', 'js', folder, '*.js')).reject{|file| file =~ /.min.js\Z/}
44
+ copy_files(files, folder_javascript_dir)
64
45
  end
65
46
 
66
47
  end
67
48
 
49
+ def copy_files(files, target_dir)
50
+ FileUtils.mkdir_p(target_dir)
51
+ FileUtils.rm_rf("#{target_dir}/.", :secure => true)
52
+
53
+ files.each do |file|
54
+ FileUtils.cp(file, target_dir, :verbose => true)
55
+ end
56
+ end
57
+
68
58
  desc 'Sanitize image paths'
69
59
  task :sanitize_image_paths do
70
60
  Dir.glob(File.join('vendor', 'assets', 'stylesheets', 'jquery-tablesorter', '*.css')).each do |file_path|
@@ -1,4 +1,4 @@
1
- require "jquery-tablesorter/engine"
1
+ require 'jquery-tablesorter/engine'
2
2
 
3
3
  module JqueryTablesorter
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = '1.10.7'
2
+ VERSION = '1.10.8'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter pager plugin
3
- * updated 3/18/2014 (v2.15.11)
3
+ * updated 3/31/2014 (v2.15.12)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -207,6 +207,7 @@
207
207
  hideRows = function(table, p){
208
208
  if (!p.ajaxUrl) {
209
209
  var i,
210
+ lastIndex = 0,
210
211
  c = table.config,
211
212
  rows = c.$tbodies.eq(0).children(),
212
213
  l = rows.length,
@@ -216,9 +217,23 @@
216
217
  j = 0; // size counter
217
218
  for ( i = 0; i < l; i++ ){
218
219
  if ( !rows[i].className.match(f) ) {
219
- rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
220
- // don't count child rows
221
- j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !p.countChildRows ? 0 : 1;
220
+ if (j === s && rows[i].className.match(c.cssChildRow)) {
221
+ // hide child rows @ start of pager (if already visible)
222
+ rows[i].style.display = 'none';
223
+ } else {
224
+ rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
225
+ // don't count child rows
226
+ j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !p.countChildRows ? 0 : 1;
227
+ if ( j === e && rows[i].style.display !== 'none' && rows[i].className.match(ts.css.cssHasChild) ) {
228
+ lastIndex = i;
229
+ }
230
+ }
231
+ }
232
+ }
233
+ // add any attached child rows to last row of pager. Fixes part of issue #396
234
+ if ( lastIndex > 0 && rows[lastIndex].className.match(ts.css.cssHasChild) ) {
235
+ while ( ++lastIndex < l && rows[lastIndex].className.match(c.cssChildRow) ) {
236
+ rows[lastIndex].style.display = '';
222
237
  }
223
238
  }
224
239
  }
@@ -457,6 +472,7 @@
457
472
  for ( i = s; i < e; i++ ) {
458
473
  $tb.append(rows[i]);
459
474
  }
475
+
460
476
  ts.processTbody(table, $tb, false);
461
477
  }
462
478
 
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * TableSorter 2.15.11 - Client-side table sorting with ease!
2
+ * TableSorter 2.15.12 - Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
5
5
  * Copyright (c) 2007 Christian Bach
@@ -24,7 +24,7 @@
24
24
 
25
25
  var ts = this;
26
26
 
27
- ts.version = "2.15.11";
27
+ ts.version = "2.15.12";
28
28
 
29
29
  ts.parsers = [];
30
30
  ts.widgets = [];
@@ -114,6 +114,7 @@
114
114
  // the table and MUST only contain one class name - fixes #381
115
115
  ts.css = {
116
116
  table : 'tablesorter',
117
+ cssHasChild: 'tablesorter-hasChildRow',
117
118
  childRow : 'tablesorter-childRow',
118
119
  header : 'tablesorter-header',
119
120
  headerRow : 'tablesorter-headerRow',
@@ -291,6 +292,10 @@
291
292
  // if this is a child row, add it to the last row's children and continue to the next row
292
293
  if (c.hasClass(tc.cssChildRow)) {
293
294
  tc.cache[k].row[tc.cache[k].row.length - 1] = tc.cache[k].row[tc.cache[k].row.length - 1].add(c);
295
+ // add "hasChild" class name to parent row
296
+ if (!c.prev().hasClass(tc.cssChildRow)) {
297
+ c.prev().addClass(ts.css.cssHasChild);
298
+ }
294
299
  // go to the next for loop
295
300
  continue;
296
301
  }
@@ -394,7 +399,7 @@
394
399
  for (j = 0; j < cells.length; j++) {
395
400
  c = cells[j];
396
401
  rowIndex = c.parentNode.rowIndex;
397
- cellId = rowIndex + "-" + c.cellIndex;
402
+ cellId = rowIndex + "-" + $(c).index();
398
403
  rowSpan = c.rowSpan || 1;
399
404
  colSpan = c.colSpan || 1;
400
405
  if (typeof(matrix[rowIndex]) === "undefined") {
@@ -424,7 +429,6 @@
424
429
  }
425
430
  // may not be accurate if # header columns !== # tbody columns
426
431
  t.config.columns = cols + 1; // add one because it's a zero-based index
427
- return lookup;
428
432
  }
429
433
 
430
434
  function formatSortingOrder(v) {
@@ -433,13 +437,15 @@
433
437
  }
434
438
 
435
439
  function buildHeaders(table) {
436
- var header_index = computeThIndexes(table), ch, $t,
437
- h, i, t, lock, time, c = table.config;
440
+ var ch, $t,
441
+ h, i, t, lock, time,
442
+ c = table.config;
438
443
  c.headerList = [];
439
444
  c.headerContent = [];
440
445
  if (c.debug) {
441
446
  time = new Date();
442
447
  }
448
+ computeThIndexes(table);
443
449
  // add icon if cssIcon option exists
444
450
  i = c.cssIcon ? '<i class="' + ( c.cssIcon === ts.css.icon ? ts.css.icon : c.cssIcon + ' ' + ts.css.icon ) + '"></i>' : '';
445
451
  c.$headers = $(table).find(c.selectorHeaders).each(function(index) {
@@ -455,8 +461,7 @@
455
461
  $(this).html('<div class="' + ts.css.headerIn + '">' + t + '</div>'); // faster than wrapInner
456
462
 
457
463
  if (c.onRenderHeader) { c.onRenderHeader.apply($t, [index]); }
458
-
459
- this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
464
+ this.column = parseInt( $(this).attr('data-column'), 10);
460
465
  this.order = formatSortingOrder( ts.getData($t, ch, 'sortInitialOrder') || c.sortInitialOrder ) ? [1,0,2] : [0,1,2];
461
466
  this.count = -1; // set to -1 because clicking on the header automatically adds one
462
467
  this.lockedOrder = false;
@@ -829,9 +834,9 @@
829
834
  // tbody may not exist if update is initialized while tbody is removed for processing
830
835
  if ($tb.length && tbdy >= 0) {
831
836
  row = $tb.eq(tbdy).find('tr').index( $row );
832
- icell = cell.cellIndex;
837
+ icell = $(cell).index();
833
838
  l = c.cache[tbdy].normalized[row].length - 1;
834
- c.cache[tbdy].row[table.config.cache[tbdy].normalized[row][l]] = $row;
839
+ c.cache[tbdy].row[ c.cache[tbdy].normalized[row][l] ] = $row;
835
840
  c.cache[tbdy].normalized[row][icell] = c.parsers[icell].format( getElementText(table, cell, icell), table, cell, icell );
836
841
  checkResort($table, resort, callback);
837
842
  }
@@ -1,4 +1,4 @@
1
- /*! tableSorter 2.15+ widgets - updated 3/18/2014 (v2.15.11)
1
+ /*! tableSorter 2.15+ widgets - updated 3/31/2014 (v2.15.12)
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -868,7 +868,7 @@ ts.filter = {
868
868
  $rows = $tbody.children('tr').not(c.selectorRemove);
869
869
  len = $rows.length;
870
870
  if (combinedFilters === '' || wo.filter_serversideFiltering) {
871
- $tbody.children().not('.' + c.cssChildRow).show().removeClass(wo.filter_filteredRow);
871
+ $tbody.children().removeClass(wo.filter_filteredRow).not('.' + c.cssChildRow).show();
872
872
  } else {
873
873
  // optimize searching only through already filtered rows - see #313
874
874
  searchFiltered = true;
@@ -990,13 +990,11 @@ ts.filter = {
990
990
  showRow = (result) ? showRow : false;
991
991
  }
992
992
  }
993
- $rows[rowIndex].style.display = (showRow ? '' : 'none');
994
- $rows.eq(rowIndex)[showRow ? 'removeClass' : 'addClass'](wo.filter_filteredRow);
993
+ $rows.eq(rowIndex)
994
+ .toggle(showRow)
995
+ .toggleClass(wo.filter_filteredRow, !showRow);
995
996
  if (childRow.length) {
996
- if (c.pager && c.pager.countChildRows || wo.pager_countChildRows || wo.filter_childRows) {
997
- childRow[showRow ? 'removeClass' : 'addClass'](wo.filter_filteredRow); // see issue #396
998
- }
999
- childRow.toggle(showRow);
997
+ childRow.toggleClass(wo.filter_filteredRow, !showRow);
1000
998
  }
1001
999
  cacheIndex++;
1002
1000
  }
@@ -1348,11 +1346,13 @@ ts.addWidget({
1348
1346
  priority: 40,
1349
1347
  options: {
1350
1348
  resizable : true,
1351
- resizable_addLastColumn : false
1349
+ resizable_addLastColumn : false,
1350
+ resizable_widths : []
1352
1351
  },
1353
1352
  format: function(table, c, wo) {
1354
1353
  if (c.$table.hasClass('hasResizable')) { return; }
1355
1354
  c.$table.addClass('hasResizable');
1355
+ ts.resizableReset(table, true); // set default widths
1356
1356
  var $rows, $columns, $column, column,
1357
1357
  storedSizes = {},
1358
1358
  $table = c.$table,
@@ -1368,7 +1368,8 @@ ts.addWidget({
1368
1368
  $target.width( storedSizes[$target.index()] );
1369
1369
  $next.width( storedSizes[$next.index()] );
1370
1370
  if (wo.resizable !== false) {
1371
- ts.storage(table, 'tablesorter-resizable', storedSizes);
1371
+ // save all column widths
1372
+ ts.storage(table, 'tablesorter-resizable', c.$headers.map(function(){ return $(this).width(); }).get() );
1372
1373
  }
1373
1374
  }
1374
1375
  mouseXPosition = 0;
@@ -1463,10 +1464,23 @@ ts.addWidget({
1463
1464
  ts.resizableReset(table);
1464
1465
  }
1465
1466
  });
1466
- ts.resizableReset = function(table) {
1467
+ ts.resizableReset = function(table, nosave) {
1467
1468
  $(table).each(function(){
1468
- this.config.$headers.not('.resizable-false').css('width','');
1469
- if (ts.storage) { ts.storage(this, 'tablesorter-resizable', {}); }
1469
+ var $t,
1470
+ c = this.config,
1471
+ wo = c && c.widgetOptions;
1472
+ if (table && c) {
1473
+ c.$headers.each(function(i){
1474
+ $t = $(this);
1475
+ if (wo.resizable_widths[i]) {
1476
+ $t.css('width', wo.resizable_widths[i]);
1477
+ } else if (!$t.hasClass('resizable-false')) {
1478
+ // don't clear the width of any column that is not resizable
1479
+ $t.css('width','');
1480
+ }
1481
+ });
1482
+ if (ts.storage && !nosave) { ts.storage(this, 'tablesorter-resizable', {}); }
1483
+ }
1470
1484
  });
1471
1485
  };
1472
1486
 
@@ -1,4 +1,4 @@
1
- /* Column Selector/Responsive table widget (beta) for TableSorter 12/17/2013 (v2.15.0)
1
+ /* Column Selector/Responsive table widget (beta) for TableSorter 3/31/2014 (v2.15.12)
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Justin Hallett & Rob Garrison
4
4
  */
@@ -83,7 +83,7 @@ tsColSel = ts.columnSelector = {
83
83
  // set default state; storage takes priority
84
84
  colSel.states[colId] = saved && typeof(saved[colId]) !== 'undefined' ?
85
85
  saved[colId] : typeof(wo.columnSelector_columns[colId]) !== 'undefined' ?
86
- wo.columnSelector_columns[colId] : state === 'true' || !(state === 'false');
86
+ wo.columnSelector_columns[colId] : (state === 'true' || !(state === 'false'));
87
87
  colSel.$column[colId] = $(this);
88
88
 
89
89
  // set default col title
@@ -96,7 +96,7 @@ tsColSel = ts.columnSelector = {
96
96
  .find('input').add( colSel.$wrapper[colId].filter('input') )
97
97
  .attr('data-column', colId)
98
98
  .prop('checked', colSel.states[colId])
99
- .bind('change', function(){
99
+ .on('change', function(){
100
100
  colSel.states[colId] = this.checked;
101
101
  tsColSel.updateCols(c, wo);
102
102
  }).change();
@@ -114,7 +114,7 @@ tsColSel = ts.columnSelector = {
114
114
  colSel.lastIndex = -1;
115
115
  wo.columnSelector_breakpoints.sort();
116
116
  tsColSel.updateBreakpoints(c, wo);
117
- c.$table.unbind('updateAll' + namespace).bind('updateAll' + namespace, function(){
117
+ c.$table.off('updateAll' + namespace).on('updateAll' + namespace, function(){
118
118
  tsColSel.updateBreakpoints(c, wo);
119
119
  tsColSel.updateCols(c, wo);
120
120
  });
@@ -129,7 +129,7 @@ tsColSel = ts.columnSelector = {
129
129
  .find('input').add( colSel.$auto.filter('input') )
130
130
  .attr('data-column', 'auto')
131
131
  .prop('checked', colSel.auto)
132
- .bind('change', function(){
132
+ .on('change', function(){
133
133
  colSel.auto = this.checked;
134
134
  $.each( colSel.$checkbox, function(i, $cb){
135
135
  if ($cb) {
@@ -156,7 +156,7 @@ tsColSel = ts.columnSelector = {
156
156
  }).change();
157
157
  }
158
158
  // Add a bind on update to re-run col setup
159
- c.$table.unbind('update' + namespace).bind('update' + namespace, function() {
159
+ c.$table.off('update' + namespace).on('update' + namespace, function() {
160
160
  tsColSel.updateCols(c, wo);
161
161
  });
162
162
  }
@@ -298,7 +298,7 @@ ts.addWidget({
298
298
  csel.$popup.empty();
299
299
  csel.$style.remove();
300
300
  csel.$breakpoints.remove();
301
- c.$table.unbind('updateAll' + namespace + ',update' + namespace);
301
+ c.$table.off('updateAll' + namespace + ' update' + namespace);
302
302
  }
303
303
 
304
304
  });
@@ -1,4 +1,4 @@
1
- /* Pager widget (beta) for TableSorter 3/18/2014 (v2.15.11) */
1
+ /* Pager widget (beta) for TableSorter 3/31/2014 (v2.15.12) */
2
2
  /*jshint browser:true, jquery:true, unused:false */
3
3
  ;(function($){
4
4
  "use strict";
@@ -181,7 +181,7 @@ tsp = ts.pager = {
181
181
  } else {
182
182
  p.ajax = false;
183
183
  // Regular pager; all rows stored in memory
184
- c.$table.trigger("appendCache", true);
184
+ c.$table.trigger("appendCache", [{}, true]);
185
185
  tsp.hideRowsSetup(table, c);
186
186
  }
187
187
 
@@ -400,6 +400,7 @@ tsp = ts.pager = {
400
400
  hideRows: function(table, c){
401
401
  if (!c.widgetOptions.pager_ajaxUrl) {
402
402
  var i,
403
+ lastIndex = 0,
403
404
  p = c.pager,
404
405
  wo = c.widgetOptions,
405
406
  rows = c.$tbodies.eq(0).children(),
@@ -410,9 +411,23 @@ tsp = ts.pager = {
410
411
  j = 0; // size counter
411
412
  for ( i = 0; i < l; i++ ){
412
413
  if ( !rows[i].className.match(f) ) {
413
- rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
414
- // don't count child rows
415
- j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !wo.pager_countChildRows ? 0 : 1;
414
+ if (j === s && rows[i].className.match(c.cssChildRow)) {
415
+ // hide child rows @ start of pager (if already visible)
416
+ rows[i].style.display = 'none';
417
+ } else {
418
+ rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
419
+ // don't count child rows
420
+ j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !wo.pager_countChildRows ? 0 : 1;
421
+ if ( j === e && rows[i].style.display !== 'none' && rows[i].className.match(ts.css.cssHasChild) ) {
422
+ lastIndex = i;
423
+ }
424
+ }
425
+ }
426
+ }
427
+ // add any attached child rows to last row of pager. Fixes part of issue #396
428
+ if ( lastIndex > 0 && rows[lastIndex].className.match(ts.css.cssHasChild) ) {
429
+ while ( ++lastIndex < l && rows[lastIndex].className.match(c.cssChildRow) ) {
430
+ rows[lastIndex].style.display = '';
416
431
  }
417
432
  }
418
433
  }
@@ -173,6 +173,10 @@ caption {
173
173
  -o-transition: height 0.1s ease;
174
174
  transition: height 0.1s ease;
175
175
  }
176
+ /* rows hidden by filtering (needed for child rows) */
177
+ .tablesorter .filtered {
178
+ display: none;
179
+ }
176
180
 
177
181
  /* ajax error row */
178
182
  .tablesorter .tablesorter-errorRow td {
@@ -208,6 +208,10 @@ caption {
208
208
  -o-transition: height 0.1s ease;
209
209
  transition: height 0.1s ease;
210
210
  }
211
+ /* rows hidden by filtering (needed for child rows) */
212
+ .tablesorter .filtered {
213
+ display: none;
214
+ }
211
215
 
212
216
  /* ajax error row */
213
217
  .tablesorter .tablesorter-errorRow td {
@@ -118,6 +118,10 @@
118
118
  opacity: 0;
119
119
  filter: alpha(opacity=0);
120
120
  }
121
+ /* rows hidden by filtering (needed for child rows) */
122
+ .tablesorter .filtered {
123
+ display: none;
124
+ }
121
125
 
122
126
  /* pager plugin */
123
127
  .tablesorter-bootstrap .tablesorter-pager select {
@@ -123,6 +123,10 @@ caption {
123
123
  opacity: 0;
124
124
  filter: alpha(opacity=0);
125
125
  }
126
+ /* rows hidden by filtering (needed for child rows) */
127
+ .tablesorter .filtered {
128
+ display: none;
129
+ }
126
130
 
127
131
  /* pager plugin */
128
132
  .tablesorter-bootstrap .tablesorter-pager select {
@@ -174,6 +174,10 @@ caption {
174
174
  -o-transition: height 0.1s ease;
175
175
  transition: height 0.1s ease;
176
176
  }
177
+ /* rows hidden by filtering (needed for child rows) */
178
+ .tablesorter .filtered {
179
+ display: none;
180
+ }
177
181
 
178
182
  /* ajax error row */
179
183
  .tablesorter .tablesorter-errorRow td {
@@ -176,6 +176,10 @@ caption {
176
176
  -o-transition: height 0.1s ease;
177
177
  transition: height 0.1s ease;
178
178
  }
179
+ /* rows hidden by filtering (needed for child rows) */
180
+ .tablesorter .filtered {
181
+ display: none;
182
+ }
179
183
 
180
184
  /* ajax error row */
181
185
  .tablesorter .tablesorter-errorRow td {
@@ -199,6 +199,10 @@ caption {
199
199
  -o-transition: height 0.1s ease;
200
200
  transition: height 0.1s ease;
201
201
  }
202
+ /* rows hidden by filtering (needed for child rows) */
203
+ .tablesorter .filtered {
204
+ display: none;
205
+ }
202
206
 
203
207
  /* ajax error row */
204
208
  .tablesorter .tablesorter-errorRow td {
@@ -190,6 +190,10 @@ caption {
190
190
  -o-transition: height 0.1s ease;
191
191
  transition: height 0.1s ease;
192
192
  }
193
+ /* rows hidden by filtering (needed for child rows) */
194
+ .tablesorter .filtered {
195
+ display: none;
196
+ }
193
197
 
194
198
  /* ajax error row */
195
199
  .tablesorter .tablesorter-errorRow td {
@@ -232,6 +232,10 @@ caption {
232
232
  -o-transition: height 0.1s ease;
233
233
  transition: height 0.1s ease;
234
234
  }
235
+ /* rows hidden by filtering (needed for child rows) */
236
+ .tablesorter .filtered {
237
+ display: none;
238
+ }
235
239
 
236
240
  /* ajax error row */
237
241
  .tablesorter .tablesorter-errorRow td {
@@ -188,6 +188,10 @@ caption {
188
188
  -o-transition: height 0.1s ease;
189
189
  transition: height 0.1s ease;
190
190
  }
191
+ /* rows hidden by filtering (needed for child rows) */
192
+ .tablesorter .filtered {
193
+ display: none;
194
+ }
191
195
 
192
196
  /* ajax error row */
193
197
  .tablesorter .tablesorter-errorRow td {
@@ -141,6 +141,10 @@
141
141
  -o-transition: height 0.1s ease;
142
142
  transition: height 0.1s ease;
143
143
  }
144
+ /* rows hidden by filtering (needed for child rows) */
145
+ .tablesorter .filtered {
146
+ display: none;
147
+ }
144
148
 
145
149
  /* ajax error row */
146
150
  .tablesorter .tablesorter-errorRow td {
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.10.7
4
+ version: 1.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Lin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-19 00:00:00.000000000 Z
12
+ date: 2014-03-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -54,20 +54,12 @@ files:
54
54
  - vendor/assets/images/jquery-tablesorter/black-unsorted.gif
55
55
  - vendor/assets/images/jquery-tablesorter/dropbox-asc-hovered.png
56
56
  - vendor/assets/images/jquery-tablesorter/dropbox-asc.png
57
- - vendor/assets/images/jquery-tablesorter/dropbox-asc1.png
58
- - vendor/assets/images/jquery-tablesorter/dropbox-asc2.png
59
57
  - vendor/assets/images/jquery-tablesorter/dropbox-desc-hovered.png
60
58
  - vendor/assets/images/jquery-tablesorter/dropbox-desc.png
61
- - vendor/assets/images/jquery-tablesorter/dropbox-desc1.png
62
- - vendor/assets/images/jquery-tablesorter/dropbox-desc2.png
63
59
  - vendor/assets/images/jquery-tablesorter/green-asc.gif
64
- - vendor/assets/images/jquery-tablesorter/green-asc.png
65
60
  - vendor/assets/images/jquery-tablesorter/green-desc.gif
66
- - vendor/assets/images/jquery-tablesorter/green-desc.png
67
61
  - vendor/assets/images/jquery-tablesorter/green-header.gif
68
- - vendor/assets/images/jquery-tablesorter/green-header.png
69
62
  - vendor/assets/images/jquery-tablesorter/green-unsorted.gif
70
- - vendor/assets/images/jquery-tablesorter/green-unsorted.png
71
63
  - vendor/assets/images/jquery-tablesorter/ice-asc.gif
72
64
  - vendor/assets/images/jquery-tablesorter/ice-desc.gif
73
65
  - vendor/assets/images/jquery-tablesorter/ice-unsorted.gif