datatables.net 2.1.2 → 2.1.4

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.
package/js/dataTables.js CHANGED
@@ -1,11 +1,11 @@
1
- /*! DataTables 2.1.2
1
+ /*! DataTables 2.1.4
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary DataTables
7
7
  * @description Paginate, search and order HTML tables
8
- * @version 2.1.2
8
+ * @version 2.1.4
9
9
  * @author SpryMedia Ltd
10
10
  * @contact www.datatables.net
11
11
  * @copyright SpryMedia Ltd.
@@ -1270,7 +1270,7 @@
1270
1270
 
1271
1271
  // Replaceable function in api.util
1272
1272
  var _stripHtml = function (input) {
1273
- if (! input) {
1273
+ if (! input || typeof input !== 'string') {
1274
1274
  return input;
1275
1275
  }
1276
1276
 
@@ -4731,7 +4731,7 @@
4731
4731
  */
4732
4732
  function _fnInitialise ( settings )
4733
4733
  {
4734
- var i, iAjaxStart=settings.iInitDisplayStart;
4734
+ var i;
4735
4735
  var init = settings.oInit;
4736
4736
  var deferLoading = settings.deferLoading;
4737
4737
  var dataSrc = _fnDataSource( settings );
@@ -4752,6 +4752,9 @@
4752
4752
  _fnDrawHead( settings, settings.aoHeader );
4753
4753
  _fnDrawHead( settings, settings.aoFooter );
4754
4754
 
4755
+ // Cache the paging start point, as the first redraw will reset it
4756
+ var iAjaxStart = settings.iInitDisplayStart
4757
+
4755
4758
  // Local data load
4756
4759
  // Check if there is data passing into the constructor
4757
4760
  if ( init.aaData ) {
@@ -4966,6 +4969,11 @@
4966
4969
  */
4967
4970
  function _fnProcessingDisplay ( settings, show )
4968
4971
  {
4972
+ // Ignore cases when we are still redrawing
4973
+ if (settings.bDrawing && show === false) {
4974
+ return;
4975
+ }
4976
+
4969
4977
  _fnCallbackFire( settings, null, 'processing', [settings, show] );
4970
4978
  }
4971
4979
 
@@ -6222,8 +6230,7 @@
6222
6230
  }
6223
6231
  }
6224
6232
 
6225
- // Restore key features - todo - for 1.11 this needs to be done by
6226
- // subscribed events
6233
+ // Restore key features
6227
6234
  if ( s.start !== undefined ) {
6228
6235
  if(api === null) {
6229
6236
  settings._iDisplayStart = s.start;
@@ -8475,8 +8482,10 @@
8475
8482
  switch( match[2] ) {
8476
8483
  case 'visIdx':
8477
8484
  case 'visible':
8478
- if (match[1]) {
8485
+ // Selector is a column index
8486
+ if (match[1] && match[1].match(/^\d+$/)) {
8479
8487
  var idx = parseInt( match[1], 10 );
8488
+
8480
8489
  // Visible index given, convert to column index
8481
8490
  if ( idx < 0 ) {
8482
8491
  // Counting from the right
@@ -8489,9 +8498,19 @@
8489
8498
  return [ _fnVisibleToColumnIndex( settings, idx ) ];
8490
8499
  }
8491
8500
 
8492
- // `:visible` on its own
8493
- return columns.map( function (col, i) {
8494
- return col.bVisible ? i : null;
8501
+ return columns.map( function (col, idx) {
8502
+ // Not visible, can't match
8503
+ if (! col.bVisible) {
8504
+ return null;
8505
+ }
8506
+
8507
+ // Selector
8508
+ if (match[1]) {
8509
+ return $(nodes[idx]).filter(match[1]).length > 0 ? idx : null;
8510
+ }
8511
+
8512
+ // `:visible` on its own
8513
+ return idx;
8495
8514
  } );
8496
8515
 
8497
8516
  case 'name':
@@ -9804,7 +9823,7 @@
9804
9823
  * @type string
9805
9824
  * @default Version number
9806
9825
  */
9807
- DataTable.version = "2.1.2";
9826
+ DataTable.version = "2.1.4";
9808
9827
 
9809
9828
  /**
9810
9829
  * Private data store, containing all of the settings objects that are
@@ -12478,7 +12497,7 @@
12478
12497
  pre: function ( a ) {
12479
12498
  // This is a little complex, but faster than always calling toString,
12480
12499
  // http://jsperf.com/tostring-v-check
12481
- return _empty(a) ?
12500
+ return _empty(a) && typeof a !== 'boolean' ?
12482
12501
  '' :
12483
12502
  typeof a === 'string' ?
12484
12503
  a.toLowerCase() :
@@ -12731,6 +12750,12 @@
12731
12750
  return; // table, not a nested one
12732
12751
  }
12733
12752
 
12753
+ var sorting = ctx.sortDetails;
12754
+
12755
+ if (! sorting) {
12756
+ return;
12757
+ }
12758
+
12734
12759
  var i;
12735
12760
  var orderClasses = classes.order;
12736
12761
  var columns = ctx.api.columns( cell );
@@ -12739,7 +12764,6 @@
12739
12764
  var ariaType = '';
12740
12765
  var indexes = columns.indexes();
12741
12766
  var sortDirs = columns.orderable(true).flatten();
12742
- var sorting = ctx.sortDetails;
12743
12767
  var orderedColumns = _pluck(sorting, 'col');
12744
12768
 
12745
12769
  cell