jquery-tablesorter 1.9.4 → 1.9.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: 3197fec8f63b2bf5f4bf265cbc7fff3c9b5c9d64
4
- data.tar.gz: 48a40143f43d45f1404a54ad46c43959dc6978b0
3
+ metadata.gz: fb4781c0bbb4cbf4d45341758149bf54411cc4f5
4
+ data.tar.gz: 6b2078616a673b55edd62f274261db6db7f75700
5
5
  SHA512:
6
- metadata.gz: d89b878769d2f9960910a39cf92aa581cc3c5aea9c16c030d7ed44fea5edaa1ed8dbb471638ddba01648bcdcd79198545cd5dc20f54005cfb3619b831b02ea95
7
- data.tar.gz: 083257783323b9725db25918f53981af9ebbeed7d24420c78d58a6ddde49a5c887a8d5f97eeb7024f1e3c62191ba834c952a283eb724efef31b1b7ddc99129b0
6
+ metadata.gz: 993255aa82f9918f3147c32708731415dd879195e0bf042da888e63df63e84b71c3c523186eaa5258a8fa5b413a61b16c44308d38275c94eeac2d9b185fbb10e
7
+ data.tar.gz: a9707e32ab2dba89ba98697d0c7edee23310f779412b6152f139d1c92b7c67d2c28bc879a978bfe8ca56aa45bbb39518ae76c56e8a48b5bac2ffdd5060064265
data/README.markdown 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.14.4 (12/14/2013), [documentation]
7
+ Current tablesorter version: 2.14.5 (12/16/2013), [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.9.4"
2
+ VERSION = "1.9.5"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter pager plugin
3
- * updated 12/14/2013 (v2.14.4)
3
+ * updated 12/16/2013 (v2.14.5)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -30,6 +30,9 @@
30
30
  dataType: 'json'
31
31
  },
32
32
 
33
+ // set this to false if you want to block ajax loading on init
34
+ processAjaxOnInit: true,
35
+
33
36
  // process ajax so that the following information is returned:
34
37
  // [ total_rows (number), rows (array of arrays), headers (array; optional) ]
35
38
  // example:
@@ -112,7 +115,7 @@
112
115
  tp = Math.min( p.totalPages, p.filteredPages );
113
116
  if ( p.updateArrows ) {
114
117
  p.$container.find(p.cssFirst + ',' + p.cssPrev)[ ( dis || p.page === 0 ) ? a : r ](d);
115
- p.$container.find(p.cssNext + ',' + p.cssLast)[ ( dis || p.page === tp - 1 ) ? a : r ](d);
118
+ p.$container.find(p.cssNext + ',' + p.cssLast)[ ( dis || p.page === tp - 1 || p.totalPages === 0 ) ? a : r ](d);
116
119
  }
117
120
  },
118
121
 
@@ -136,7 +139,7 @@
136
139
  s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
137
140
  // {page} = one-based index; {page+#} = zero based index +/- value
138
141
  .replace(/\{page([\-+]\d+)?\}/gi, function(m,n){
139
- return p.page + (n ? parseInt(n, 10) : 1);
142
+ return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
140
143
  })
141
144
  // {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
142
145
  .replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
@@ -272,7 +275,7 @@
272
275
  //ensure a zero returned row count doesn't fail the logical ||
273
276
  rr_count = result[t ? 1 : 0];
274
277
  p.totalRows = isNaN(rr_count) ? p.totalRows || 0 : rr_count;
275
- d = p.totalRows === 0 ? [] : result[t ? 0 : 1] || []; // row data
278
+ d = p.totalRows === 0 ? [""] : result[t ? 0 : 1] || []; // row data
276
279
  th = result[2]; // headers
277
280
  }
278
281
  l = d.length;
@@ -290,12 +293,12 @@
290
293
  tds += '</tr>';
291
294
  }
292
295
  // add rows to first tbody
293
- c.$tbodies.eq(0).html( tds );
296
+ p.processAjaxOnInit ? c.$tbodies.eq(0).html( tds ) : p.processAjaxOnInit = true;
294
297
  }
295
298
  // only add new header text if the length matches
296
299
  if ( th && th.length === hl ) {
297
300
  hsh = $t.hasClass('hasStickyHeaders');
298
- $sh = hsh ? c.$sticky.children('thead:first').children().children() : '';
301
+ $sh = hsh ? c.widgetOptions.$sticky.children('thead:first').children().children() : '';
299
302
  $f = $t.find('tfoot tr:first').children();
300
303
  // don't change td headers (may contain pager)
301
304
  c.$headers.filter('th').each(function(j){
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * TableSorter 2.14.4 - Client-side table sorting with ease!
2
+ * TableSorter 2.14.5 - 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.14.4";
27
+ ts.version = "2.14.5";
28
28
 
29
29
  ts.parsers = [];
30
30
  ts.widgets = [];
@@ -1,4 +1,4 @@
1
- /*! tableSorter 2.8+ widgets - updated 12/14/2013 (v2.14.4)
1
+ /*! tableSorter 2.8+ widgets - updated 12/16/2013 (v2.14.5)
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -1066,7 +1066,10 @@ ts.addWidget({
1066
1066
  stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs
1067
1067
  },
1068
1068
  format: function(table, c, wo) {
1069
- if (c.$table.hasClass('hasStickyHeaders')) { return; }
1069
+ // filter widget doesn't initialize on an empty table. Fixes #449
1070
+ if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
1071
+ return;
1072
+ }
1070
1073
  var $cell,
1071
1074
  $table = c.$table,
1072
1075
  $attach = $(wo.stickyHeaders_attachTo),
@@ -1086,7 +1089,7 @@ ts.addWidget({
1086
1089
  margin : 0,
1087
1090
  top : stickyOffset,
1088
1091
  left : 0,
1089
- visibility : $attach.length ? 'visible' : 'hidden',
1092
+ visibility : 'hidden',
1090
1093
  zIndex : wo.stickyHeaders_zIndex ? wo.stickyHeaders_zIndex : 2
1091
1094
  }),
1092
1095
  $stickyThead = $stickyTable.children('thead:first').addClass('tablesorter-stickyHeader ' + wo.stickyHeaders),
@@ -1105,8 +1108,8 @@ ts.addWidget({
1105
1108
  spacing = parseInt($header.eq(0).css('border-left-width'), 10) * 2;
1106
1109
  }
1107
1110
  $stickyTable.css({
1108
- left : $attach.length ? parseInt($table.css('padding-left'), 10) +
1109
- parseInt($table.css('margin-left'), 10) + parseInt($table.css('border-left-width'), 10) :
1111
+ left : $attach.length ? parseInt($attach.css('padding-left'), 10) +
1112
+ parseInt($attach.css('margin-left'), 10) + parseInt($table.css('border-left-width'), 10) :
1110
1113
  $thead.offset().left - $win.scrollLeft() - spacing,
1111
1114
  width: $table.width()
1112
1115
  });
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.9.4
4
+ version: 1.9.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: 2013-12-15 00:00:00.000000000 Z
12
+ date: 2013-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties