jquery-datatables 1.10.16 → 1.10.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +2 -0
  3. data/app/assets/javascripts/datatables/dataTables.foundation.js +2 -2
  4. data/app/assets/javascripts/datatables/dataTables.uikit.js +1 -1
  5. data/app/assets/javascripts/datatables/extensions/AutoFill/autoFill.dataTables.js +38 -0
  6. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +52 -12
  7. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +4 -8
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.dataTables.js +38 -0
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +17 -7
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +33 -19
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +14 -3
  12. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +120 -53
  13. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.bootstrap.js +38 -0
  14. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.bootstrap4.js +38 -0
  15. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.dataTables.js +38 -0
  16. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.foundation.js +38 -0
  17. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.jqueryui.js +38 -0
  18. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.semanicui.js +38 -0
  19. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +76 -13
  20. data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +23 -17
  21. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.bootstrap.js +38 -0
  22. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.js +38 -0
  23. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.dataTables.js +38 -0
  24. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.foundation.js +38 -0
  25. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.jqueryui.js +38 -0
  26. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.semanicui.js +38 -0
  27. data/app/assets/javascripts/datatables/extensions/FixedHeader/dataTables.fixedHeader.js +26 -11
  28. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.bootstrap.js +38 -0
  29. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.bootstrap4.js +38 -0
  30. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.dataTables.js +38 -0
  31. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.foundation.js +38 -0
  32. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.jqueryui.js +38 -0
  33. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.semanicui.js +38 -0
  34. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +141 -75
  35. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.bootstrap.js +38 -0
  36. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.bootstrap4.js +38 -0
  37. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.dataTables.js +38 -0
  38. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.foundation.js +38 -0
  39. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.jqueryui.js +38 -0
  40. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.semanicui.js +38 -0
  41. data/app/assets/javascripts/datatables/extensions/Responsive/dataTables.responsive.js +64 -26
  42. data/app/assets/javascripts/datatables/extensions/Responsive/responsive.dataTables.js +38 -0
  43. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +45 -13
  44. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.bootstrap.js +38 -0
  45. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.bootstrap4.js +38 -0
  46. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.dataTables.js +38 -0
  47. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.foundation.js +38 -0
  48. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.jqueryui.js +38 -0
  49. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.semanicui.js +38 -0
  50. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +24 -6
  51. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.bootstrap.js +38 -0
  52. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.bootstrap4.js +38 -0
  53. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.dataTables.js +38 -0
  54. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.foundation.js +38 -0
  55. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.jqueryui.js +38 -0
  56. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.semanicui.js +38 -0
  57. data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +93 -87
  58. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.bootstrap.js +38 -0
  59. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.bootstrap4.js +38 -0
  60. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.dataTables.js +38 -0
  61. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.foundation.js +38 -0
  62. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.jqueryui.js +38 -0
  63. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.semanticui.js +38 -0
  64. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +41 -14
  65. data/app/assets/javascripts/datatables/extensions/Select/select.bootstrap.js +38 -0
  66. data/app/assets/javascripts/datatables/extensions/Select/select.bootstrap4.js +38 -0
  67. data/app/assets/javascripts/datatables/extensions/Select/select.dataTables.js +38 -0
  68. data/app/assets/javascripts/datatables/extensions/Select/select.foundation.js +38 -0
  69. data/app/assets/javascripts/datatables/extensions/Select/select.jqueryui.js +38 -0
  70. data/app/assets/javascripts/datatables/extensions/Select/select.semanticui.js +38 -0
  71. data/app/assets/javascripts/datatables/jquery.dataTables.js +125 -72
  72. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.scss +4 -0
  73. data/app/assets/stylesheets/datatables/dataTables.foundation.scss +5 -5
  74. data/app/assets/stylesheets/datatables/dataTables.material.scss +1 -1
  75. data/app/assets/stylesheets/datatables/dataTables.uikit.scss +33 -22
  76. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.scss +9 -0
  77. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.scss +9 -0
  78. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +3 -2
  79. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +2 -4
  80. data/app/assets/stylesheets/datatables/extensions/Buttons/mixins.scss +5 -0
  81. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.scss +3 -6
  82. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.scss +1 -1
  83. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.scss +1 -1
  84. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +6 -5
  85. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.scss +1 -1
  86. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.scss +1 -1
  87. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.scss +1 -1
  88. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.scss +2 -4
  89. data/app/assets/stylesheets/datatables/jquery.dataTables.scss +5 -5
  90. data/jquery-datatables.gemspec +4 -2
  91. data/lib/generators/jquery/datatables/install_generator.rb +22 -6
  92. data/lib/generators/jquery/datatables/templates/{bootstrap.js.tt → javascripts/bootstrap.js.tt} +0 -0
  93. data/lib/generators/jquery/datatables/templates/{bootstrap4.js.tt → javascripts/bootstrap4.js.tt} +0 -0
  94. data/lib/generators/jquery/datatables/templates/{foundation.js.tt → javascripts/foundation.js.tt} +0 -0
  95. data/lib/generators/jquery/datatables/templates/javascripts/initializer.js.tt +30 -0
  96. data/lib/generators/jquery/datatables/templates/{jqueryui.js.tt → javascripts/jqueryui.js.tt} +0 -0
  97. data/lib/generators/jquery/datatables/templates/{material.js.tt → javascripts/material.js.tt} +0 -0
  98. data/lib/generators/jquery/datatables/templates/{regular.js.tt → javascripts/regular.js.tt} +0 -0
  99. data/lib/generators/jquery/datatables/templates/{semanticui.js.tt → javascripts/semanticui.js.tt} +0 -0
  100. data/lib/generators/jquery/datatables/templates/{uikit.js.tt → javascripts/uikit.js.tt} +0 -0
  101. data/lib/generators/jquery/datatables/templates/{bootstrap.scss.tt → stylesheets/bootstrap.scss.tt} +0 -0
  102. data/lib/generators/jquery/datatables/templates/{bootstrap4.scss.tt → stylesheets/bootstrap4.scss.tt} +0 -0
  103. data/lib/generators/jquery/datatables/templates/{foundation.scss.tt → stylesheets/foundation.scss.tt} +0 -0
  104. data/lib/generators/jquery/datatables/templates/{jqueryui.scss.tt → stylesheets/jqueryui.scss.tt} +0 -0
  105. data/lib/generators/jquery/datatables/templates/{material.scss.tt → stylesheets/material.scss.tt} +0 -0
  106. data/lib/generators/jquery/datatables/templates/{regular.scss.tt → stylesheets/regular.scss.tt} +0 -0
  107. data/lib/generators/jquery/datatables/templates/{semanticui.scss.tt → stylesheets/semanticui.scss.tt} +0 -0
  108. data/lib/generators/jquery/datatables/templates/{uikit.scss.tt → stylesheets/uikit.scss.tt} +0 -0
  109. data/lib/generators/jquery/datatables/templates/views/index.html.erb +17 -0
  110. data/lib/generators/jquery/datatables/templates/views/index.html.slim +12 -0
  111. data/lib/generators/jquery/datatables/templates/views/index.json.jbuilder +10 -0
  112. data/lib/jquery-datatables.rb +53 -5
  113. data/lib/jquery-datatables/engine.rb +2 -0
  114. data/lib/jquery-datatables/version.rb +1 -1
  115. metadata +86 -31
@@ -0,0 +1,38 @@
1
+ /*! DataTables styling wrapper for ColReorder
2
+ * ©2018 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ (function( factory ){
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-dt', 'datatables.net-colreorder'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
+
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-dt')(root, $).$;
21
+ }
22
+
23
+ if ( ! $.fn.dataTable.ColReorder ) {
24
+ require('datatables.net-colreorder')(root, $);
25
+ }
26
+
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
+ }(function( $, window, document, undefined ) {
35
+
36
+ return $.fn.dataTable;
37
+
38
+ }));
@@ -0,0 +1,38 @@
1
+ /*! Bootstrap 4 styling wrapper for ColReorder
2
+ * ©2018 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ (function( factory ){
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-zf', 'datatables.net-colreorder'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
+
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-zf')(root, $).$;
21
+ }
22
+
23
+ if ( ! $.fn.dataTable.ColReorder ) {
24
+ require('datatables.net-colreorder')(root, $);
25
+ }
26
+
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
+ }(function( $, window, document, undefined ) {
35
+
36
+ return $.fn.dataTable;
37
+
38
+ }));
@@ -0,0 +1,38 @@
1
+ /*! jQuery UI styling wrapper for ColReorder
2
+ * ©2018 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ (function( factory ){
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-jqui', 'datatables.net-colreorder'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
+
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-jqui')(root, $).$;
21
+ }
22
+
23
+ if ( ! $.fn.dataTable.ColReorder ) {
24
+ require('datatables.net-colreorder')(root, $);
25
+ }
26
+
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
+ }(function( $, window, document, undefined ) {
35
+
36
+ return $.fn.dataTable;
37
+
38
+ }));
@@ -0,0 +1,38 @@
1
+ /*! Semanic UI styling wrapper for ColReorder
2
+ * ©2018 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ (function( factory ){
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-se', 'datatables.net-colreorder'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
+
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-se')(root, $).$;
21
+ }
22
+
23
+ if ( ! $.fn.dataTable.ColReorder ) {
24
+ require('datatables.net-colreorder')(root, $);
25
+ }
26
+
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
+ }(function( $, window, document, undefined ) {
35
+
36
+ return $.fn.dataTable;
37
+
38
+ }));
@@ -1,15 +1,15 @@
1
- /*! ColReorder 1.4.1
2
- * ©2010-2017 SpryMedia Ltd - datatables.net/license
1
+ /*! ColReorder 1.5.0
2
+ * ©2010-2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary ColReorder
7
7
  * @description Provide the ability to reorder columns in a DataTable
8
- * @version 1.4.1
8
+ * @version 1.5.0
9
9
  * @file dataTables.colReorder.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact www.sprymedia.co.uk/contact
12
- * @copyright Copyright 2010-2017 SpryMedia Ltd.
12
+ * @copyright Copyright 2010-2018 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/mit
@@ -341,7 +341,7 @@ $.fn.dataTableExt.oApi.fnColReorder = function ( oSettings, iFrom, iTo, drop, in
341
341
  /* Sort listener */
342
342
  for ( i=0, iLen=iCols ; i<iLen ; i++ )
343
343
  {
344
- $(oSettings.aoColumns[i].nTh).off('click.DT');
344
+ $(oSettings.aoColumns[i].nTh).off('.DT');
345
345
  this.oApi._fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );
346
346
  }
347
347
 
@@ -405,6 +405,14 @@ var ColReorder = function( dt, opts )
405
405
  */
406
406
  "dt": null,
407
407
 
408
+ /**
409
+ * Enable flag
410
+ * @property dt
411
+ * @type Object
412
+ * @default null
413
+ */
414
+ "enable": null,
415
+
408
416
  /**
409
417
  * Initialisation object used for this instance
410
418
  * @property init
@@ -484,8 +492,8 @@ var ColReorder = function( dt, opts )
484
492
  "pointer": null
485
493
  };
486
494
 
487
-
488
495
  /* Constructor logic */
496
+ this.s.enable = this.s.init.bEnable;
489
497
  this.s.dt = settings;
490
498
  this.s.dt._colReorder = this;
491
499
  this._fnConstruct();
@@ -500,6 +508,26 @@ $.extend( ColReorder.prototype, {
500
508
  * Public methods
501
509
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
502
510
 
511
+ /**
512
+ * Enable / disable end user interaction
513
+ */
514
+ fnEnable: function ( flag )
515
+ {
516
+ if ( flag === false ) {
517
+ return fnDisable();
518
+ }
519
+
520
+ this.s.enable = true;
521
+ },
522
+
523
+ /**
524
+ * Disable end user interaction
525
+ */
526
+ fnDisable: function ()
527
+ {
528
+ this.s.enable = false;
529
+ },
530
+
503
531
  /**
504
532
  * Reset the column ordering to the original ordering that was detected on
505
533
  * start up.
@@ -740,9 +768,9 @@ $.extend( ColReorder.prototype, {
740
768
  // Destroy clean up
741
769
  $(table).on( 'destroy.dt.colReorder', function () {
742
770
  $(table).off( 'destroy.dt.colReorder draw.dt.colReorder' );
743
- $(that.s.dt.nTHead).find( '*' ).off( '.ColReorder' );
744
771
 
745
772
  $.each( that.s.dt.aoColumns, function (i, column) {
773
+ $(column.nTh).off('.ColReorder');
746
774
  $(column.nTh).removeAttr('data-column-index');
747
775
  } );
748
776
 
@@ -785,8 +813,6 @@ $.extend( ColReorder.prototype, {
785
813
  }
786
814
  }
787
815
 
788
- $.fn.dataTable.Api( this.s.dt ).rows().invalidate();
789
-
790
816
  this._fnSetColumnIndexes();
791
817
 
792
818
  // Has anything actually changed? If not, then nothing else to do
@@ -794,6 +820,8 @@ $.extend( ColReorder.prototype, {
794
820
  return;
795
821
  }
796
822
 
823
+ $.fn.dataTable.Api( this.s.dt ).rows().invalidate();
824
+
797
825
  /* When scrolling we need to recalculate the column sizes to allow for the shift */
798
826
  if ( this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "" )
799
827
  {
@@ -889,10 +917,14 @@ $.extend( ColReorder.prototype, {
889
917
  var that = this;
890
918
  $(nTh)
891
919
  .on( 'mousedown.ColReorder', function (e) {
892
- that._fnMouseDown.call( that, e, nTh );
920
+ if ( that.s.enable ) {
921
+ that._fnMouseDown.call( that, e, nTh );
922
+ }
893
923
  } )
894
924
  .on( 'touchstart.ColReorder', function (e) {
895
- that._fnMouseDown.call( that, e, nTh );
925
+ if ( that.s.enable ) {
926
+ that._fnMouseDown.call( that, e, nTh );
927
+ }
896
928
  } );
897
929
  },
898
930
 
@@ -996,8 +1028,15 @@ $.extend( ColReorder.prototype, {
996
1028
 
997
1029
  // Perform reordering if realtime updating is on and the column has moved
998
1030
  if ( this.s.init.bRealtime && lastToIndex !== this.s.mouse.toIndex ) {
999
- this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex, false );
1031
+ this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex );
1000
1032
  this.s.mouse.fromIndex = this.s.mouse.toIndex;
1033
+
1034
+ // Not great for performance, but required to keep everything in alignment
1035
+ if ( this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "" )
1036
+ {
1037
+ this.s.dt.oInstance.fnAdjustColumnSizing( false );
1038
+ }
1039
+
1001
1040
  this._fnRegions();
1002
1041
  }
1003
1042
  },
@@ -1208,6 +1247,14 @@ ColReorder.defaults = {
1208
1247
  */
1209
1248
  aiOrder: null,
1210
1249
 
1250
+ /**
1251
+ * ColReorder enable on initialisation
1252
+ * @type boolean
1253
+ * @default true
1254
+ * @static
1255
+ */
1256
+ bEnable: true,
1257
+
1211
1258
  /**
1212
1259
  * Redraw the table's column ordering as the end user draws the column
1213
1260
  * (`true`) or wait until the mouse is released (`false` - default). Note
@@ -1259,7 +1306,7 @@ ColReorder.defaults = {
1259
1306
  * @type String
1260
1307
  * @default As code
1261
1308
  */
1262
- ColReorder.version = "1.4.1";
1309
+ ColReorder.version = "1.5.0";
1263
1310
 
1264
1311
 
1265
1312
 
@@ -1354,6 +1401,22 @@ $.fn.dataTable.Api.register( 'colReorder.move()', function( from, to, drop, inva
1354
1401
  return this;
1355
1402
  } );
1356
1403
 
1404
+ $.fn.dataTable.Api.register( 'colReorder.enable()', function( flag ) {
1405
+ return this.iterator( 'table', function ( ctx ) {
1406
+ if ( ctx._colReorder ) {
1407
+ ctx._colReorder.fnEnable( flag );
1408
+ }
1409
+ } );
1410
+ } );
1411
+
1412
+ $.fn.dataTable.Api.register( 'colReorder.disable()', function() {
1413
+ return this.iterator( 'table', function ( ctx ) {
1414
+ if ( ctx._colReorder ) {
1415
+ ctx._colReorder.fnDisable();
1416
+ }
1417
+ } );
1418
+ } );
1419
+
1357
1420
 
1358
1421
  return ColReorder;
1359
1422
  }));
@@ -1,15 +1,15 @@
1
- /*! FixedColumns 3.2.3
2
- * ©2010-2016 SpryMedia Ltd - datatables.net/license
1
+ /*! FixedColumns 3.2.5
2
+ * ©2010-2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary FixedColumns
7
7
  * @description Freeze columns in place on a scrolling DataTable
8
- * @version 3.2.3
8
+ * @version 3.2.5
9
9
  * @file dataTables.fixedColumns.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact www.sprymedia.co.uk/contact
12
- * @copyright Copyright 2010-2016 SpryMedia Ltd.
12
+ * @copyright Copyright 2010-2018 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/mit
@@ -501,12 +501,14 @@ $.extend( FixedColumns.prototype , {
501
501
 
502
502
  // When the mouse is down (drag scroll) the mouse controller cannot
503
503
  // change, as the browser keeps the original element as the scrolling one
504
- $(this.s.dt.nTableWrapper).on( 'mousedown.DTFC', function () {
505
- mouseDown = true;
504
+ $(this.s.dt.nTableWrapper).on( 'mousedown.DTFC', function (e) {
505
+ if ( e.button === 0 ) {
506
+ mouseDown = true;
506
507
 
507
- $(document).one( 'mouseup', function () {
508
- mouseDown = false;
509
- } );
508
+ $(document).one( 'mouseup', function () {
509
+ mouseDown = false;
510
+ } );
511
+ }
510
512
  } );
511
513
 
512
514
  // When the body is scrolled - scroll the left and right columns
@@ -677,13 +679,17 @@ $.extend( FixedColumns.prototype , {
677
679
  // account of it, but it isn't in any cell
678
680
  if ( that.s.aiOuterWidths.length === 0 ) {
679
681
  border = $(that.s.dt.nTable).css('border-left-width');
680
- iWidth += typeof border === 'string' ? 1 : parseInt( border, 10 );
682
+ iWidth += typeof border === 'string' && border.indexOf('px') === -1 ?
683
+ 1 :
684
+ parseInt( border, 10 );
681
685
  }
682
686
 
683
687
  // Likewise with the final column on the right
684
688
  if ( that.s.aiOuterWidths.length === that.s.dt.aoColumns.length-1 ) {
685
689
  border = $(that.s.dt.nTable).css('border-right-width');
686
- iWidth += typeof border === 'string' ? 1 : parseInt( border, 10 );
690
+ iWidth += typeof border === 'string' && border.indexOf('px') === -1 ?
691
+ 1 :
692
+ parseInt( border, 10 );
687
693
  }
688
694
 
689
695
  that.s.aiOuterWidths.push( iWidth );
@@ -727,14 +733,14 @@ $.extend( FixedColumns.prototype , {
727
733
 
728
734
  var nSWrapper =
729
735
  $('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;">'+
730
- '<div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;">'+
736
+ '<div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;" aria-hidden="true">'+
731
737
  '<div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
732
738
  '<div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;">'+
733
739
  '<div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div>'+
734
740
  '</div>'+
735
741
  '<div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
736
742
  '</div>'+
737
- '<div class="DTFC_RightWrapper" style="position:absolute; top:0; right:0;">'+
743
+ '<div class="DTFC_RightWrapper" style="position:absolute; top:0; right:0;" aria-hidden="true">'+
738
744
  '<div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;">'+
739
745
  '<div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div>'+
740
746
  '</div>'+
@@ -819,8 +825,8 @@ $.extend( FixedColumns.prototype , {
819
825
  var that = this;
820
826
  var oGrid = this.dom.grid;
821
827
  var iWidth = $(oGrid.wrapper).width();
822
- var iBodyHeight = $(this.s.dt.nTable.parentNode).outerHeight();
823
- var iFullHeight = $(this.s.dt.nTable.parentNode.parentNode).outerHeight();
828
+ var iBodyHeight = this.s.dt.nTable.parentNode.offsetHeight;
829
+ var iFullHeight = this.s.dt.nTable.parentNode.parentNode.offsetHeight;
824
830
  var oOverflow = this._fnDTOverflow();
825
831
  var iLeftWidth = this.s.iLeftWidth;
826
832
  var iRightWidth = this.s.iRightWidth;
@@ -1220,7 +1226,7 @@ $.extend( FixedColumns.prototype , {
1220
1226
  nClone = $( aTds[iColumn] ).clone(true, true)[0];
1221
1227
  nClone.removeAttribute( 'id' );
1222
1228
  nClone.setAttribute( 'data-dt-row', i );
1223
- nClone.setAttribute( 'data-dt-column', dt.oApi._fnVisibleToColumnIndex( dt, iColumn ) );
1229
+ nClone.setAttribute( 'data-dt-column', iColumn );
1224
1230
  n.appendChild( nClone );
1225
1231
  }
1226
1232
  }
@@ -1519,7 +1525,7 @@ FixedColumns.defaults = /** @lends FixedColumns.defaults */{
1519
1525
  * @default See code
1520
1526
  * @static
1521
1527
  */
1522
- FixedColumns.version = "3.2.3";
1528
+ FixedColumns.version = "3.2.5";
1523
1529
 
1524
1530
 
1525
1531
 
@@ -0,0 +1,38 @@
1
+ /*! Bootstrap 3 styling wrapper for FixedColumns
2
+ * ©2018 SpryMedia Ltd - datatables.net/license
3
+ */
4
+
5
+ (function( factory ){
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-bs', 'datatables.net-fixedcolumns'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
+
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-bs')(root, $).$;
21
+ }
22
+
23
+ if ( ! $.fn.dataTable.FixedColumns ) {
24
+ require('datatables.net-fixedcolumns')(root, $);
25
+ }
26
+
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
+ }(function( $, window, document, undefined ) {
35
+
36
+ return $.fn.dataTable;
37
+
38
+ }));