jquery-datatables 1.10.19.1 → 1.10.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/README.md +28 -1
  4. data/app/assets/javascripts/datatables/dataTables.uikit.js +2 -2
  5. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +42 -29
  6. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap.js +1 -1
  7. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap4.js +8 -2
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +6 -3
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.foundation.js +5 -4
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +58 -6
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +16 -5
  12. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.semanticui.js +1 -1
  13. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +267 -152
  14. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.foundation.js +1 -1
  15. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +121 -52
  16. data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +32 -5
  17. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +166 -63
  18. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.foundation.js +1 -1
  19. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +105 -53
  20. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.foundation.js +1 -1
  21. data/app/assets/javascripts/datatables/extensions/RowGroup/{rowGroup.semanicui.js → rowGroup.semanticui.js} +0 -0
  22. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +10 -9
  23. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.foundation.js +1 -1
  24. data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +519 -636
  25. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.foundation.js +1 -1
  26. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +49 -18
  27. data/app/assets/javascripts/datatables/extensions/Select/select.foundation.js +1 -1
  28. data/app/assets/javascripts/datatables/jquery.dataTables.js +97 -60
  29. data/app/assets/javascripts/datatables/plugins/api/average.js +7 -6
  30. data/app/assets/javascripts/datatables/plugins/api/sum.js +7 -6
  31. data/app/assets/javascripts/datatables/plugins/pagination/ellipses.js +160 -0
  32. data/app/assets/javascripts/datatables/plugins/pagination/extjs.js +137 -0
  33. data/app/assets/javascripts/datatables/plugins/pagination/four_button.js +110 -0
  34. data/app/assets/javascripts/datatables/plugins/pagination/full_numbers_no_ellipses.js +59 -0
  35. data/app/assets/javascripts/datatables/plugins/pagination/input.js +22 -19
  36. data/app/assets/javascripts/datatables/plugins/pagination/scrolling.js +130 -0
  37. data/app/assets/javascripts/datatables/plugins/pagination/select.js +97 -0
  38. data/app/assets/javascripts/datatables/plugins/pagination/simple_incremental_bootstrap.js +154 -0
  39. data/app/assets/javascripts/datatables/plugins/pagination/simple_numbers_no_ellipses.js +59 -0
  40. data/app/assets/javascripts/datatables/plugins/search/dataTables.alphabetSearch.js +440 -399
  41. data/app/assets/javascripts/datatables/plugins/sorting/enum.js +51 -0
  42. data/app/assets/javascripts/datatables/plugins/type-detection/date-dd-MMM-yyyy.js +63 -0
  43. data/app/assets/javascripts/datatables/plugins/type-detection/date-de.js +125 -0
  44. data/app/assets/javascripts/datatables/plugins/type-detection/date-eu.js +64 -0
  45. data/app/assets/javascripts/datatables/plugins/type-detection/date-euro.js +48 -0
  46. data/app/assets/javascripts/datatables/plugins/type-detection/date-uk.js +35 -12
  47. data/app/assets/javascripts/datatables/plugins/type-detection/datetime-moment.js +74 -0
  48. data/app/assets/javascripts/datatables/plugins/type-detection/datetime-us.js +86 -0
  49. data/app/assets/javascripts/datatables/plugins/type-detection/file-size.js +37 -13
  50. data/app/assets/javascripts/datatables/plugins/type-detection/ip-address.js +113 -11
  51. data/app/assets/javascripts/datatables/plugins/type-detection/numString.js +63 -0
  52. data/app/assets/javascripts/datatables/plugins/type-detection/percent.js +34 -0
  53. data/app/assets/javascripts/datatables/plugins/type-detection/time-elapsed-dhms.js +42 -0
  54. data/app/assets/javascripts/datatables/plugins/type-detection/time.js +56 -0
  55. data/app/assets/javascripts/datatables/plugins/type-detection/title-numeric.js +40 -0
  56. data/app/assets/javascripts/datatables/plugins/type-detection/title-string.js +36 -0
  57. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.scss +10 -3
  58. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.scss +12 -3
  59. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.scss +13 -6
  60. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +2 -0
  61. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.scss +5 -1
  62. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +1 -0
  63. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.scss +2 -1
  64. data/app/assets/stylesheets/datatables/extensions/Buttons/common.scss +10 -0
  65. data/app/assets/stylesheets/datatables/extensions/Buttons/mixins.scss +42 -30
  66. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.scss +11 -7
  67. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.foundation.scss +1 -0
  68. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +13 -5
  69. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.scss +20 -2
  70. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.scss +15 -2
  71. data/lib/jquery-datatables/version.rb +1 -1
  72. metadata +26 -12
  73. data/app/assets/javascripts/datatables/dataTables.bootstrap2.js +0 -162
  74. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.semanicui.js +0 -38
  75. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.semanicui.js +0 -38
  76. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.semanicui.js +0 -38
  77. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.semanicui.js +0 -38
  78. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.semanicui.js +0 -38
  79. data/app/assets/stylesheets/datatables/dataTables.bootstrap2.scss +0 -178
@@ -1,4 +1,4 @@
1
- /*! Bootstrap 4 styling wrapper for Scroller
1
+ /*! Foundation styling wrapper for Scroller
2
2
  * ©2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -1,16 +1,16 @@
1
- /*! Select for DataTables 1.2.7
2
- * 2015-2018 SpryMedia Ltd - datatables.net/license/mit
1
+ /*! Select for DataTables 1.3.1
2
+ * 2015-2019 SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary Select for DataTables
7
7
  * @description A collection of API methods, events and buttons for DataTables
8
8
  * that provides selection options of the items in a DataTable
9
- * @version 1.2.7
9
+ * @version 1.3.1
10
10
  * @file dataTables.select.js
11
11
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
12
12
  * @contact datatables.net/forums
13
- * @copyright Copyright 2015-2018 SpryMedia Ltd.
13
+ * @copyright Copyright 2015-2019 SpryMedia Ltd.
14
14
  *
15
15
  * This source file is free software, available under the following license:
16
16
  * MIT license - http://datatables.net/license/mit
@@ -54,7 +54,7 @@ var DataTable = $.fn.dataTable;
54
54
  // Version information for debugger
55
55
  DataTable.select = {};
56
56
 
57
- DataTable.select.version = '1.2.7';
57
+ DataTable.select.version = '1.3.1';
58
58
 
59
59
  DataTable.select.init = function ( dt ) {
60
60
  var ctx = dt.settings()[0];
@@ -68,6 +68,7 @@ DataTable.select.init = function ( dt ) {
68
68
  var items = 'row';
69
69
  var style = 'api';
70
70
  var blurable = false;
71
+ var toggleable = true;
71
72
  var info = true;
72
73
  var selector = 'td, th';
73
74
  var className = 'selected';
@@ -88,6 +89,10 @@ DataTable.select.init = function ( dt ) {
88
89
  if ( opts.blurable !== undefined ) {
89
90
  blurable = opts.blurable;
90
91
  }
92
+
93
+ if ( opts.toggleable !== undefined ) {
94
+ toggleable = opts.toggleable;
95
+ }
91
96
 
92
97
  if ( opts.info !== undefined ) {
93
98
  info = opts.info;
@@ -101,6 +106,10 @@ DataTable.select.init = function ( dt ) {
101
106
  style = opts.style;
102
107
  setStyle = true;
103
108
  }
109
+ else {
110
+ style = 'os';
111
+ setStyle = true;
112
+ }
104
113
 
105
114
  if ( opts.selector !== undefined ) {
106
115
  selector = opts.selector;
@@ -115,6 +124,7 @@ DataTable.select.init = function ( dt ) {
115
124
  dt.select.items( items );
116
125
  dt.select.style( style );
117
126
  dt.select.blurable( blurable );
127
+ dt.select.toggleable( toggleable );
118
128
  dt.select.info( info );
119
129
  ctx._select.className = className;
120
130
 
@@ -176,15 +186,17 @@ The `_select` object contains the following properties:
176
186
 
177
187
  ```
178
188
  {
179
- items:string - Can be `rows`, `columns` or `cells`. Defines what item
180
- will be selected if the user is allowed to activate row
181
- selection using the mouse.
182
- style:string - Can be `none`, `single`, `multi` or `os`. Defines the
183
- interaction style when selecting items
184
- blurable:boolean - If row selection can be cleared by clicking outside of
185
- the table
186
- info:boolean - If the selection summary should be shown in the table
187
- information elements
189
+ items:string - Can be `rows`, `columns` or `cells`. Defines what item
190
+ will be selected if the user is allowed to activate row
191
+ selection using the mouse.
192
+ style:string - Can be `none`, `single`, `multi` or `os`. Defines the
193
+ interaction style when selecting items
194
+ blurable:boolean - If row selection can be cleared by clicking outside of
195
+ the table
196
+ toggleable:boolean - If row selection can be cancelled by repeated clicking
197
+ on the row
198
+ info:boolean - If the selection summary should be shown in the table
199
+ information elements
188
200
  }
189
201
  ```
190
202
 
@@ -310,7 +322,7 @@ function disableMouseSelection( dt )
310
322
  .off( 'mouseup.dtSelect', selector )
311
323
  .off( 'click.dtSelect', selector );
312
324
 
313
- $('body').off( 'click.dtSelect' + dt.table().node().id );
325
+ $('body').off( 'click.dtSelect' + _safeId(dt.table().node()) );
314
326
  }
315
327
 
316
328
  /**
@@ -353,7 +365,7 @@ function enableMouseSelection ( dt )
353
365
 
354
366
  // If text was selected (click and drag), then we shouldn't change
355
367
  // the row's selected state
356
- if ( window.getSelection ) {
368
+ if ( matchSelection ) {
357
369
  var selection = window.getSelection();
358
370
 
359
371
  // If the element that contains the selection is not in the table, we can ignore it
@@ -366,7 +378,7 @@ function enableMouseSelection ( dt )
366
378
  }
367
379
 
368
380
  var ctx = dt.settings()[0];
369
- var wrapperClass = dt.settings()[0].oClasses.sWrapper.replace(/ /g, '.');
381
+ var wrapperClass = $.trim(dt.settings()[0].oClasses.sWrapper).replace(/ +/g, '.');
370
382
 
371
383
  // Ignore clicks inside a sub-table
372
384
  if ( $(e.target).closest('div.'+wrapperClass)[0] != dt.table().container() ) {
@@ -406,7 +418,7 @@ function enableMouseSelection ( dt )
406
418
  } );
407
419
 
408
420
  // Blurable
409
- $('body').on( 'click.dtSelect' + dt.table().node().id, function ( e ) {
421
+ $('body').on( 'click.dtSelect' + _safeId(dt.table().node()), function ( e ) {
410
422
  if ( ctx._select.blurable ) {
411
423
  // If the click was inside the DataTables container, don't blur
412
424
  if ( $(e.target).parents().filter( dt.table().container() ).length ) {
@@ -666,7 +678,12 @@ function clear( ctx, force )
666
678
  function typeSelect ( e, dt, ctx, type, idx )
667
679
  {
668
680
  var style = dt.select.style();
681
+ var toggleable = dt.select.toggleable();
669
682
  var isSelected = dt[type]( idx, { selected: true } ).any();
683
+
684
+ if ( isSelected && ! toggleable ) {
685
+ return;
686
+ }
670
687
 
671
688
  if ( style === 'os' ) {
672
689
  if ( e.ctrlKey || e.metaKey ) {
@@ -718,6 +735,10 @@ function typeSelect ( e, dt, ctx, type, idx )
718
735
  }
719
736
  }
720
737
 
738
+ function _safeId( node ) {
739
+ return node.id.replace(/[^a-zA-Z0-9\-\_]/g, '-');
740
+ }
741
+
721
742
 
722
743
 
723
744
  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -805,6 +826,16 @@ apiRegister( 'select.blurable()', function ( flag ) {
805
826
  } );
806
827
  } );
807
828
 
829
+ apiRegister( 'select.toggleable()', function ( flag ) {
830
+ if ( flag === undefined ) {
831
+ return this.context[0]._select.toggleable;
832
+ }
833
+
834
+ return this.iterator( 'table', function ( ctx ) {
835
+ ctx._select.toggleable = flag;
836
+ } );
837
+ } );
838
+
808
839
  apiRegister( 'select.info()', function ( flag ) {
809
840
  if ( info === undefined ) {
810
841
  return this.context[0]._select.info;
@@ -1,4 +1,4 @@
1
- /*! Bootstrap 4 styling wrapper for Select
1
+ /*! Foundation styling wrapper for Select
2
2
  * ©2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -1,15 +1,15 @@
1
- /*! DataTables 1.10.19
2
- * ©2008-2018 SpryMedia Ltd - datatables.net/license
1
+ /*! DataTables 1.10.20
2
+ * ©2008-2019 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 1.10.19
8
+ * @version 1.10.20
9
9
  * @file jquery.dataTables.js
10
10
  * @author SpryMedia Ltd
11
11
  * @contact www.datatables.net
12
- * @copyright Copyright 2008-2018 SpryMedia Ltd.
12
+ * @copyright Copyright 2008-2019 SpryMedia Ltd.
13
13
  *
14
14
  * This source file is free software, available under the following license:
15
15
  * MIT license - http://datatables.net/license
@@ -898,7 +898,7 @@
898
898
  _fnCamelToHungarian( defaults.column, defaults.column, true );
899
899
 
900
900
  /* Setting up the initialisation object */
901
- _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ) );
901
+ _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ), true );
902
902
 
903
903
 
904
904
 
@@ -1334,7 +1334,7 @@
1334
1334
  var _api_registerPlural; // DataTable.Api.registerPlural
1335
1335
 
1336
1336
  var _re_dic = {};
1337
- var _re_new_lines = /[\r\n]/g;
1337
+ var _re_new_lines = /[\r\n\u2028]/g;
1338
1338
  var _re_html = /<.*?>/g;
1339
1339
 
1340
1340
  // This is not strict ISO8601 - Date.parse() is quite lax, although
@@ -2024,7 +2024,7 @@
2024
2024
  _fnCompatCols( oOptions );
2025
2025
 
2026
2026
  // Map camel case parameters to their Hungarian counterparts
2027
- _fnCamelToHungarian( DataTable.defaults.column, oOptions );
2027
+ _fnCamelToHungarian( DataTable.defaults.column, oOptions, true );
2028
2028
 
2029
2029
  /* Backwards compatibility for mDataProp */
2030
2030
  if ( oOptions.mDataProp !== undefined && !oOptions.mData )
@@ -3078,7 +3078,7 @@
3078
3078
  rowData = row._aData,
3079
3079
  cells = [],
3080
3080
  nTr, nTd, oCol,
3081
- i, iLen;
3081
+ i, iLen, create;
3082
3082
 
3083
3083
  if ( row.nTr === null )
3084
3084
  {
@@ -3099,8 +3099,9 @@
3099
3099
  for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
3100
3100
  {
3101
3101
  oCol = oSettings.aoColumns[i];
3102
+ create = nTrIn ? false : true;
3102
3103
 
3103
- nTd = nTrIn ? anTds[i] : document.createElement( oCol.sCellType );
3104
+ nTd = create ? document.createElement( oCol.sCellType ) : anTds[i];
3104
3105
  nTd._DT_CellIndex = {
3105
3106
  row: iRow,
3106
3107
  column: i
@@ -3109,9 +3110,9 @@
3109
3110
  cells.push( nTd );
3110
3111
 
3111
3112
  // Need to create the HTML if new, or if a rendering function is defined
3112
- if ( (!nTrIn || oCol.mRender || oCol.mData !== i) &&
3113
+ if ( create || ((!nTrIn || oCol.mRender || oCol.mData !== i) &&
3113
3114
  (!$.isPlainObject(oCol.mData) || oCol.mData._ !== i+'.display')
3114
- ) {
3115
+ )) {
3115
3116
  nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
3116
3117
  }
3117
3118
 
@@ -4406,6 +4407,7 @@
4406
4407
  // New search - start from the master array
4407
4408
  if ( invalidated ||
4408
4409
  force ||
4410
+ regex ||
4409
4411
  prevSearch.length > input.length ||
4410
4412
  input.indexOf(prevSearch) !== 0 ||
4411
4413
  settings.bSorted // On resort, the display master needs to be
@@ -4529,7 +4531,7 @@
4529
4531
  }
4530
4532
 
4531
4533
  if ( cellData.replace ) {
4532
- cellData = cellData.replace(/[\r\n]/g, '');
4534
+ cellData = cellData.replace(/[\r\n\u2028]/g, '');
4533
4535
  }
4534
4536
 
4535
4537
  filterData.push( cellData );
@@ -5457,7 +5459,7 @@
5457
5459
  table.children('colgroup').insertBefore( table.children('thead') );
5458
5460
 
5459
5461
  /* Adjust the position of the header in case we loose the y-scrollbar */
5460
- divBody.scroll();
5462
+ divBody.trigger('scroll');
5461
5463
 
5462
5464
  // If sorting or filtering has occurred, jump the scrolling back to the top
5463
5465
  // only if we aren't holding the position
@@ -6410,7 +6412,7 @@
6410
6412
 
6411
6413
  _fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, s] );
6412
6414
  callback();
6413
- }
6415
+ };
6414
6416
 
6415
6417
  if ( ! settings.oFeatures.bStateSave ) {
6416
6418
  callback();
@@ -6890,7 +6892,7 @@
6890
6892
  var ctxSettings = function ( o ) {
6891
6893
  var a = _toSettings( o );
6892
6894
  if ( a ) {
6893
- settings = settings.concat( a );
6895
+ settings.push.apply( settings, a );
6894
6896
  }
6895
6897
  };
6896
6898
 
@@ -7188,8 +7190,7 @@
7188
7190
 
7189
7191
  var
7190
7192
  i, ien,
7191
- j, jen,
7192
- struct, inner,
7193
+ struct,
7193
7194
  methodScoping = function ( scope, fn, struc ) {
7194
7195
  return function () {
7195
7196
  var ret = fn.apply( scope, arguments );
@@ -7204,9 +7205,9 @@
7204
7205
  struct = ext[i];
7205
7206
 
7206
7207
  // Value
7207
- obj[ struct.name ] = typeof struct.val === 'function' ?
7208
+ obj[ struct.name ] = struct.type === 'function' ?
7208
7209
  methodScoping( scope, struct.val, struct ) :
7209
- $.isPlainObject( struct.val ) ?
7210
+ struct.type === 'object' ?
7210
7211
  {} :
7211
7212
  struct.val;
7212
7213
 
@@ -7287,13 +7288,19 @@
7287
7288
  name: key,
7288
7289
  val: {},
7289
7290
  methodExt: [],
7290
- propExt: []
7291
+ propExt: [],
7292
+ type: 'object'
7291
7293
  };
7292
7294
  struct.push( src );
7293
7295
  }
7294
7296
 
7295
7297
  if ( i === ien-1 ) {
7296
7298
  src.val = val;
7299
+ src.type = typeof val === 'function' ?
7300
+ 'function' :
7301
+ $.isPlainObject( val ) ?
7302
+ 'object' :
7303
+ 'other';
7297
7304
  }
7298
7305
  else {
7299
7306
  struct = method ?
@@ -7303,7 +7310,6 @@
7303
7310
  }
7304
7311
  };
7305
7312
 
7306
-
7307
7313
  _Api.registerPlural = _api_registerPlural = function ( pluralName, singularName, val ) {
7308
7314
  _Api.register( pluralName, val );
7309
7315
 
@@ -7916,7 +7922,7 @@
7916
7922
  [];
7917
7923
  }
7918
7924
  else if ( cellIdx ) {
7919
- return aoData[ cellIdx.row ] && aoData[ cellIdx.row ].nTr === sel ?
7925
+ return aoData[ cellIdx.row ] && aoData[ cellIdx.row ].nTr === sel.parentNode ?
7920
7926
  [ cellIdx.row ] :
7921
7927
  [];
7922
7928
  }
@@ -8575,16 +8581,6 @@
8575
8581
 
8576
8582
  // Common actions
8577
8583
  col.bVisible = vis;
8578
- _fnDrawHead( settings, settings.aoHeader );
8579
- _fnDrawHead( settings, settings.aoFooter );
8580
-
8581
- // Update colspan for no records display. Child rows and extensions will use their own
8582
- // listeners to do this - only need to update the empty table item here
8583
- if ( ! settings.aiDisplay.length ) {
8584
- $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
8585
- }
8586
-
8587
- _fnSaveState( settings );
8588
8584
  };
8589
8585
 
8590
8586
 
@@ -8648,6 +8644,7 @@
8648
8644
  } );
8649
8645
 
8650
8646
  _api_registerPlural( 'columns().visible()', 'column().visible()', function ( vis, calc ) {
8647
+ var that = this;
8651
8648
  var ret = this.iterator( 'column', function ( settings, column ) {
8652
8649
  if ( vis === undefined ) {
8653
8650
  return settings.aoColumns[ column ].bVisible;
@@ -8657,14 +8654,28 @@
8657
8654
 
8658
8655
  // Group the column visibility changes
8659
8656
  if ( vis !== undefined ) {
8660
- // Second loop once the first is done for events
8661
- this.iterator( 'column', function ( settings, column ) {
8662
- _fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, calc] );
8663
- } );
8657
+ this.iterator( 'table', function ( settings ) {
8658
+ // Redraw the header after changes
8659
+ _fnDrawHead( settings, settings.aoHeader );
8660
+ _fnDrawHead( settings, settings.aoFooter );
8661
+
8662
+ // Update colspan for no records display. Child rows and extensions will use their own
8663
+ // listeners to do this - only need to update the empty table item here
8664
+ if ( ! settings.aiDisplay.length ) {
8665
+ $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
8666
+ }
8667
+
8668
+ _fnSaveState( settings );
8664
8669
 
8665
- if ( calc === undefined || calc ) {
8666
- this.columns.adjust();
8667
- }
8670
+ // Second loop once the first is done for events
8671
+ that.iterator( 'column', function ( settings, column ) {
8672
+ _fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, calc] );
8673
+ } );
8674
+
8675
+ if ( calc === undefined || calc ) {
8676
+ that.columns.adjust();
8677
+ }
8678
+ });
8668
8679
  }
8669
8680
 
8670
8681
  return ret;
@@ -8815,13 +8826,20 @@
8815
8826
  } );
8816
8827
  }
8817
8828
 
8829
+ // The default built in options need to apply to row and columns
8830
+ var internalOpts = opts ? {
8831
+ page: opts.page,
8832
+ order: opts.order,
8833
+ search: opts.search
8834
+ } : {};
8835
+
8818
8836
  // Row + column selector
8819
- var columns = this.columns( columnSelector );
8820
- var rows = this.rows( rowSelector );
8821
- var a, i, ien, j, jen;
8837
+ var columns = this.columns( columnSelector, internalOpts );
8838
+ var rows = this.rows( rowSelector, internalOpts );
8839
+ var i, ien, j, jen;
8822
8840
 
8823
- this.iterator( 'table', function ( settings, idx ) {
8824
- a = [];
8841
+ var cellsNoOpts = this.iterator( 'table', function ( settings, idx ) {
8842
+ var a = [];
8825
8843
 
8826
8844
  for ( i=0, ien=rows[idx].length ; i<ien ; i++ ) {
8827
8845
  for ( j=0, jen=columns[idx].length ; j<jen ; j++ ) {
@@ -8831,10 +8849,16 @@
8831
8849
  } );
8832
8850
  }
8833
8851
  }
8852
+
8853
+ return a;
8834
8854
  }, 1 );
8835
8855
 
8836
- // Now pass through the cell selector for options
8837
- var cells = this.cells( a, opts );
8856
+ // There is currently only one extension which uses a cell selector extension
8857
+ // It is a _major_ performance drag to run this if it isn't needed, so this is
8858
+ // an extension specific check at the moment
8859
+ var cells = opts && opts.selected ?
8860
+ this.cells( cellsNoOpts, opts ) :
8861
+ cellsNoOpts;
8838
8862
 
8839
8863
  $.extend( cells.selector, {
8840
8864
  cols: columnSelector,
@@ -9455,7 +9479,6 @@
9455
9479
 
9456
9480
  return resolved.replace( '%d', plural ); // nb: plural might be undefined,
9457
9481
  } );
9458
-
9459
9482
  /**
9460
9483
  * Version string for plug-ins to check compatibility. Allowed format is
9461
9484
  * `a.b.c-d` where: a:int, b:int, c:int, d:string(dev|beta|alpha). `d` is used
@@ -9464,7 +9487,7 @@
9464
9487
  * @type string
9465
9488
  * @default Version number
9466
9489
  */
9467
- DataTable.version = "1.10.19";
9490
+ DataTable.version = "1.10.20";
9468
9491
 
9469
9492
  /**
9470
9493
  * Private data store, containing all of the settings objects that are
@@ -14527,7 +14550,8 @@
14527
14550
  var btnDisplay, btnClass, counter=0;
14528
14551
 
14529
14552
  var attach = function( container, buttons ) {
14530
- var i, ien, node, button;
14553
+ var i, ien, node, button, tabIndex;
14554
+ var disabledClass = classes.sPageButtonDisabled;
14531
14555
  var clickHandler = function ( e ) {
14532
14556
  _fnPageChange( settings, e.data.action, true );
14533
14557
  };
@@ -14542,7 +14566,8 @@
14542
14566
  }
14543
14567
  else {
14544
14568
  btnDisplay = null;
14545
- btnClass = '';
14569
+ btnClass = button;
14570
+ tabIndex = settings.iTabIndex;
14546
14571
 
14547
14572
  switch ( button ) {
14548
14573
  case 'ellipsis':
@@ -14551,26 +14576,38 @@
14551
14576
 
14552
14577
  case 'first':
14553
14578
  btnDisplay = lang.sFirst;
14554
- btnClass = button + (page > 0 ?
14555
- '' : ' '+classes.sPageButtonDisabled);
14579
+
14580
+ if ( page === 0 ) {
14581
+ tabIndex = -1;
14582
+ btnClass += ' ' + disabledClass;
14583
+ }
14556
14584
  break;
14557
14585
 
14558
14586
  case 'previous':
14559
14587
  btnDisplay = lang.sPrevious;
14560
- btnClass = button + (page > 0 ?
14561
- '' : ' '+classes.sPageButtonDisabled);
14588
+
14589
+ if ( page === 0 ) {
14590
+ tabIndex = -1;
14591
+ btnClass += ' ' + disabledClass;
14592
+ }
14562
14593
  break;
14563
14594
 
14564
14595
  case 'next':
14565
14596
  btnDisplay = lang.sNext;
14566
- btnClass = button + (page < pages-1 ?
14567
- '' : ' '+classes.sPageButtonDisabled);
14597
+
14598
+ if ( page === pages-1 ) {
14599
+ tabIndex = -1;
14600
+ btnClass += ' ' + disabledClass;
14601
+ }
14568
14602
  break;
14569
14603
 
14570
14604
  case 'last':
14571
14605
  btnDisplay = lang.sLast;
14572
- btnClass = button + (page < pages-1 ?
14573
- '' : ' '+classes.sPageButtonDisabled);
14606
+
14607
+ if ( page === pages-1 ) {
14608
+ tabIndex = -1;
14609
+ btnClass += ' ' + disabledClass;
14610
+ }
14574
14611
  break;
14575
14612
 
14576
14613
  default:
@@ -14586,7 +14623,7 @@
14586
14623
  'aria-controls': settings.sTableId,
14587
14624
  'aria-label': aria[ button ],
14588
14625
  'data-dt-idx': counter,
14589
- 'tabindex': settings.iTabIndex,
14626
+ 'tabindex': tabIndex,
14590
14627
  'id': idx === 0 && typeof button === 'string' ?
14591
14628
  settings.sTableId +'_'+ button :
14592
14629
  null
@@ -15214,7 +15251,7 @@
15214
15251
 
15215
15252
  /**
15216
15253
  * Processing event, fired when DataTables is doing some kind of processing
15217
- * (be it, order, searcg or anything else). It can be used to indicate to
15254
+ * (be it, order, search or anything else). It can be used to indicate to
15218
15255
  * the end user that there is something happening, or that something has
15219
15256
  * finished.
15220
15257
  * @name DataTable#processing.dt