jquery-tablesorter 1.10.1 → 1.10.2

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: f993d3ad9edc10a4ede7f829031260e60b3de88c
4
- data.tar.gz: f6a09c02fc388e5322308d39e076c16d40a1cd7d
3
+ metadata.gz: 3396def36d6cc6f842581564ce732beb60b74b0b
4
+ data.tar.gz: 358c05de2c83d9c84884ed4d6fc94da9711effc8
5
5
  SHA512:
6
- metadata.gz: 2a22160b93179c27adaa2d57d649512fa9eee01224ed89c119ee366c059b4fa42550b45a1985f01fc23511f0a778d6d68f6379044d11d7ba8319411777ce54f3
7
- data.tar.gz: c7e04027e5100364c0d6bb412c92a8d9f954244b635cb854db493b563fc8b7ba06b05e89fed39c41d781cb90da75ac97597615a06353664604205e8831d1c2be
6
+ metadata.gz: 0d9ad4211f5b1c5b8b354fdb9c032ad84434295188faf3f80003cc7fae6e4bdd4dda41aac038d068c3a8c8c04e816338b5f1d32d032208a03d170619e1f65687
7
+ data.tar.gz: 6fa02f3d32fca3186c8122b5dbed1c2e4ff0a6e3e4340d6d19a913acac08f8b1bede9618f788706f13417d8c97613d62c20a12886f03319ca3b14a0f59ae3541
@@ -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.1 (2/19/2014), [documentation]
7
+ Current tablesorter version: 2.15.4 (2/22/2014), [documentation]
8
8
 
9
9
  Any issue associate with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = "1.10.1"
2
+ VERSION = "1.10.2"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter pager plugin
3
- * updated 2/19/2014 (v2.15.0)
3
+ * updated 2/22/2014 (v2.15.4)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -336,18 +336,19 @@
336
336
  p.last.sortList = (c.sortList || []).join(',');
337
337
  updatePageDisplay(table, p);
338
338
  fixHeight(table, p);
339
- // apply widgets after table has rendered
340
- $t.trigger('applyWidgets');
341
- $t.trigger('updateRows', [false, function(){
339
+ $t.trigger('updateCache', [function(){
342
340
  if (p.initialized) {
343
- $t.trigger('updateComplete');
341
+ // apply widgets after table has rendered
342
+ $t.trigger('applyWidgets');
344
343
  $t.trigger('pagerChange', p);
345
344
  }
346
345
  }]);
347
346
  }
348
347
  if (!p.initialized) {
349
348
  p.initialized = true;
350
- $(table).trigger('pagerInitialized', p);
349
+ $(table)
350
+ .trigger('applyWidgets')
351
+ .trigger('pagerInitialized', p);
351
352
  }
352
353
  },
353
354
 
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * TableSorter 2.15.1 - Client-side table sorting with ease!
2
+ * TableSorter 2.15.4 - 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.1";
27
+ ts.version = "2.15.4";
28
28
 
29
29
  ts.parsers = [];
30
30
  ts.widgets = [];
@@ -777,7 +777,7 @@
777
777
  $table = c.$table;
778
778
  // apply easy methods that trigger bound events
779
779
  $table
780
- .unbind('sortReset update updateRows updateCell updateAll addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave '.split(' ').join('.tablesorter '))
780
+ .unbind('sortReset update updateRows updateCell updateAll addRows sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave '.split(' ').join('.tablesorter '))
781
781
  .bind("sortReset.tablesorter", function(e){
782
782
  e.stopPropagation();
783
783
  c.sortList = [];
@@ -878,6 +878,17 @@
878
878
  callback(table);
879
879
  }
880
880
  })
881
+ .bind("updateCache.tablesorter", function(e, callback){
882
+ // rebuild parsers
883
+ if (!c.parsers) {
884
+ buildParserCache(table);
885
+ }
886
+ // rebuild the cache map
887
+ buildCache(table);
888
+ if (typeof callback === "function") {
889
+ callback(table);
890
+ }
891
+ })
881
892
  .bind("applyWidgetId.tablesorter", function(e, id) {
882
893
  e.stopPropagation();
883
894
  ts.getWidgetById(id).format(table, c, c.widgetOptions);
@@ -1076,6 +1087,8 @@
1076
1087
  if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
1077
1088
  // jQuery v1.2.6 doesn't have closest()
1078
1089
  cell = /TH|TD/.test(this.tagName) ? this : $(this).parents('th, td')[0];
1090
+ // reference original table headers and find the same cell
1091
+ cell = c.$headers[ $headers.index( cell ) ];
1079
1092
  if (!cell.sortDisabled) {
1080
1093
  initSort(table, cell, e);
1081
1094
  }
@@ -1,4 +1,4 @@
1
- /*! tableSorter 2.8+ widgets - updated 2/19/2014 (v2.15.1)
1
+ /*! tableSorter 2.8+ widgets - updated 2/21/2014 (v2.15.3)
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -571,11 +571,11 @@ ts.filter = {
571
571
  } else {
572
572
  // send false argument to force a new search; otherwise if the filter hasn't changed, it will return
573
573
  filter = event.type === 'search' ? filter : event.type === 'updateComplete' ? c.$table.data('lastSearch') : '';
574
- if (/(update|add)/.test(event.type)) {
574
+ if (/(update|add)/.test(event.type) && event.type !== "updateComplete") {
575
575
  // force a new search since content has changed
576
576
  c.lastCombinedFilter = null;
577
577
  }
578
- // pass true (dontSkip) to prevent the tablesorter.setFilters function from skipping the first input
578
+ // pass true (skipFirst) to prevent the tablesorter.setFilters function from skipping the first input
579
579
  // ensures all inputs are updated when a search is triggered on the table $('table').trigger('search', [...]);
580
580
  ts.filter.searching(table, filter, true);
581
581
  }
@@ -758,22 +758,22 @@ ts.filter = {
758
758
  ( event.which >= 37 && event.which <= 40 ) || (event.which !== 13 && wo.filter_liveSearch === false) ) ) ) {
759
759
  return;
760
760
  }
761
- // true flag in getFilters forces obtaining the latest values
762
- ts.filter.searching( table, filters || ts.getFilters( table, true ), true );
761
+ // true flag tells getFilters to skip newest timed input
762
+ ts.filter.searching( table, '', true );
763
763
  });
764
764
  c.$table.bind('filterReset', function(){
765
765
  $el.val('');
766
766
  });
767
767
  },
768
- checkFilters: function(table, filter, dontSkip) {
768
+ checkFilters: function(table, filter, skipFirst) {
769
769
  var c = table.config,
770
770
  wo = c.widgetOptions,
771
771
  filterArray = $.isArray(filter),
772
- filters = (filterArray) ? filter : ts.getFilters(table),
772
+ filters = (filterArray) ? filter : ts.getFilters(table, true),
773
773
  combinedFilters = (filters || []).join(''); // combined filter values
774
774
  // add filter array back into inputs
775
775
  if (filterArray) {
776
- ts.setFilters( table, filters, false, dontSkip !== true );
776
+ ts.setFilters( table, filters, false, skipFirst !== true );
777
777
  }
778
778
  if (wo.filter_hideFilters) {
779
779
  // show/hide filter row as needed
@@ -817,7 +817,7 @@ ts.filter = {
817
817
  // $(':focus') needs jQuery 1.6+
818
818
  if ( $(document.activeElement).closest('tr')[0] !== $filterRow[0] ) {
819
819
  // don't hide row if any filter has a value
820
- if (ts.getFilters(table).join('') === '') {
820
+ if (c.lastCombinedFilter === '') {
821
821
  $filterRow.addClass('hideme');
822
822
  }
823
823
  }
@@ -850,7 +850,7 @@ ts.filter = {
850
850
  anyMatchNotAllowedTypes = [ 'range', 'notMatch', 'operators' ],
851
851
  // parse columns after formatter, in case the class is added at that point
852
852
  parsed = c.$headers.map(function(columnIndex) {
853
- return c.parsers && c.parsers[columnIndex].parsed || ( ts.getData ?
853
+ return c.parsers && c.parsers[columnIndex] && c.parsers[columnIndex].parsed || ( ts.getData ?
854
854
  ts.getData(c.$headers.filter('[data-column="' + columnIndex + '"]:last'), c.headers[columnIndex], 'filter') === 'parsed' :
855
855
  $(this).hasClass('filter-parsed') );
856
856
  }).get();
@@ -1011,7 +1011,7 @@ ts.filter = {
1011
1011
  },
1012
1012
  buildSelect: function(table, column, updating, onlyavail) {
1013
1013
  column = parseInt(column, 10);
1014
- var indx, rowIndex, tbodyIndex, len, currentValue, txt,
1014
+ var indx, rowIndex, tbodyIndex, len, currentValue, txt, $filters,
1015
1015
  c = table.config,
1016
1016
  wo = c.widgetOptions,
1017
1017
  $tbodies = c.$tbodies,
@@ -1054,7 +1054,12 @@ ts.filter = {
1054
1054
  options += arry[indx] !== '' ? '<option value="' + txt + '"' + (currentValue === txt ? ' selected="selected"' : '') +
1055
1055
  '>' + arry[indx] + '</option>' : '';
1056
1056
  }
1057
- c.$table.find('thead').find('select.' + ts.css.filter + '[data-column="' + column + '"]')[ updating ? 'html' : 'append' ](options);
1057
+ // update all selects in the same column (clone thead in sticky headers & any external selects) - fixes 473
1058
+ $filters = ( c.$filters ? c.$filters : c.$table.children('thead') ).find('.' + ts.css.filter);
1059
+ if (wo.filter_$externalFilters) {
1060
+ $filters = $filters && $filters.length ? $filters.add(wo.filter_$externalFilters) : wo.filter_$externalFilters;
1061
+ }
1062
+ $filters.filter('select[data-column="' + column + '"]')[ updating ? 'html' : 'append' ](options);
1058
1063
  },
1059
1064
  buildDefault: function(table, updating) {
1060
1065
  var columnIndex, $header,
@@ -1073,17 +1078,17 @@ ts.filter = {
1073
1078
  }
1074
1079
  }
1075
1080
  },
1076
- searching: function(table, filter, dontSkip) {
1081
+ searching: function(table, filter, skipFirst) {
1077
1082
  if (typeof filter === 'undefined' || filter === true) {
1078
1083
  var wo = table.config.widgetOptions;
1079
1084
  // delay filtering
1080
1085
  clearTimeout(wo.searchTimer);
1081
1086
  wo.searchTimer = setTimeout(function() {
1082
- ts.filter.checkFilters(table, filter, dontSkip );
1087
+ ts.filter.checkFilters(table, filter, skipFirst );
1083
1088
  }, wo.filter_liveSearch ? wo.filter_searchDelay : 10);
1084
1089
  } else {
1085
1090
  // skip delay
1086
- ts.filter.checkFilters(table, filter, dontSkip);
1091
+ ts.filter.checkFilters(table, filter, skipFirst);
1087
1092
  }
1088
1093
  }
1089
1094
  };
@@ -1110,7 +1115,7 @@ ts.getFilters = function(table, getRaw, setFilters, skipFirst) {
1110
1115
  if ($column.length) {
1111
1116
  // move the latest search to the first slot in the array
1112
1117
  $column = $column.sort(function(a, b){
1113
- return $(a).attr('data-lastSearchTime') <= $(b).attr('data-lastSearchTime');
1118
+ return $(b).attr('data-lastSearchTime') - $(a).attr('data-lastSearchTime');
1114
1119
  });
1115
1120
  if ($.isArray(setFilters)) {
1116
1121
  // skip first (latest input) to maintain cursor position while typing
@@ -1224,8 +1229,8 @@ ts.addWidget({
1224
1229
  // fix clone ID, if it exists - fixes #271
1225
1230
  if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
1226
1231
  // clear out cloned table, except for sticky header
1227
- // include caption & filter row (fixes #126 & #249)
1228
- $stickyTable.find('thead:gt(0), tr.sticky-false, tbody, tfoot').remove();
1232
+ // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
1233
+ $stickyTable.find('thead:gt(0), tr.sticky-false, tbody, tfoot').hide();
1229
1234
  if (!wo.stickyHeaders_includeCaption) {
1230
1235
  $stickyTable.find('caption').remove();
1231
1236
  } else {
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.1
4
+ version: 1.10.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: 2014-02-20 00:00:00.000000000 Z
12
+ date: 2014-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties