jquery-datatables 1.10.15 → 1.10.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -16
  3. data/Rakefile +46 -27
  4. data/app/assets/javascripts/datatables/dataTables.bootstrap4.js +3 -3
  5. data/app/assets/javascripts/datatables/dataTables.jqueryui.js +6 -6
  6. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +5 -5
  7. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap.js +3 -1
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap4.js +3 -1
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +2 -1
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +74 -69
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.foundation.js +3 -1
  12. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +86 -63
  13. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +16 -22
  14. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +131 -3
  15. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +12 -6
  16. data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +8 -5
  17. data/app/assets/javascripts/datatables/extensions/FixedHeader/dataTables.fixedHeader.js +14 -9
  18. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +103 -8
  19. data/app/assets/javascripts/datatables/extensions/Responsive/dataTables.responsive.js +106 -6
  20. data/app/assets/javascripts/datatables/extensions/Responsive/responsive.bootstrap4.js +1 -1
  21. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +8 -6
  22. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +68 -35
  23. data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +71 -10
  24. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +11 -7
  25. data/app/assets/javascripts/datatables/jquery.dataTables.js +19 -121
  26. data/app/assets/stylesheets/datatables/dataTables.bootstrap.scss +252 -0
  27. data/app/assets/stylesheets/datatables/{dataTables.bootstrap2.css → dataTables.bootstrap2.scss} +6 -6
  28. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.scss +262 -0
  29. data/app/assets/stylesheets/datatables/dataTables.foundation.scss +154 -0
  30. data/app/assets/stylesheets/datatables/dataTables.jqueryui.scss +93 -0
  31. data/app/assets/stylesheets/datatables/dataTables.material.scss +101 -0
  32. data/app/assets/stylesheets/datatables/dataTables.semanticui.scss +138 -0
  33. data/app/assets/stylesheets/datatables/dataTables.uikit.scss +195 -0
  34. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.scss +8 -0
  35. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.scss +8 -0
  36. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.scss +125 -0
  37. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.foundation.scss +13 -0
  38. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.jqueryui.scss +10 -0
  39. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.semanticui.scss +8 -0
  40. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.scss +40 -0
  41. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.scss +53 -0
  42. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +141 -0
  43. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.scss +82 -0
  44. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +98 -0
  45. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.scss +53 -0
  46. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap.scss +4 -0
  47. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap4.scss +4 -0
  48. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.dataTables.scss +17 -0
  49. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.foundation.scss +4 -0
  50. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.jqueryui.scss +2 -0
  51. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.semanticui.scss +4 -0
  52. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.scss +50 -0
  53. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.scss +11 -0
  54. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.dataTables.scss +22 -0
  55. data/app/assets/stylesheets/datatables/extensions/FixedColumns/{fixedColumns.foundation.css → fixedColumns.foundation.scss} +15 -6
  56. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.jqueryui.scss +16 -0
  57. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.semanticui.scss +41 -0
  58. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.bootstrap4.css → fixedHeader.bootstrap.scss} +6 -5
  59. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.foundation.css → fixedHeader.bootstrap4.scss} +6 -5
  60. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.dataTables.scss +21 -0
  61. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.bootstrap.css → fixedHeader.foundation.scss} +6 -5
  62. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.semanticui.css → fixedHeader.jqueryui.scss} +7 -3
  63. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.semanticui.scss +16 -0
  64. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.scss +4 -0
  65. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.scss +4 -0
  66. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +10 -0
  67. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.scss +4 -0
  68. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.jqueryui.scss +2 -0
  69. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.scss +4 -0
  70. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap.scss +8 -0
  71. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap4.scss +9 -0
  72. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.dataTables.scss +240 -0
  73. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.foundation.scss +10 -0
  74. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.jqueryui.scss +2 -0
  75. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.semanticui.scss +9 -0
  76. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap.scss +2 -0
  77. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap4.scss +2 -0
  78. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.scss +9 -0
  79. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.foundation.scss +2 -0
  80. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.jqueryui.scss +2 -0
  81. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.semanticui.scss +4 -0
  82. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap.scss +5 -0
  83. data/app/assets/stylesheets/datatables/extensions/RowReorder/{semanticui.scss → rowReorder.bootstrap4.scss} +0 -0
  84. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.dataTables.scss +26 -0
  85. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.foundation.scss +5 -0
  86. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.jqueryui.scss +2 -0
  87. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.semanticui.scss +5 -0
  88. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.scss +9 -0
  89. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.scss +9 -0
  90. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.scss +36 -0
  91. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.foundation.scss +31 -0
  92. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.jqueryui.scss +2 -0
  93. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.semanticui.scss +2 -0
  94. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.scss +17 -0
  95. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.scss +17 -0
  96. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.scss +143 -0
  97. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.scss +18 -0
  98. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.scss +4 -0
  99. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.scss +14 -0
  100. data/app/assets/stylesheets/datatables/jquery.dataTables.scss +599 -0
  101. data/lib/generators/jquery/datatables/install_generator.rb +1 -1
  102. data/lib/generators/jquery/datatables/templates/bootstrap.js.tt +3 -1
  103. data/lib/generators/jquery/datatables/templates/bootstrap.scss.tt +15 -0
  104. data/lib/generators/jquery/datatables/templates/bootstrap4.js.tt +3 -1
  105. data/lib/generators/jquery/datatables/templates/bootstrap4.scss.tt +15 -0
  106. data/lib/generators/jquery/datatables/templates/foundation.js.tt +4 -4
  107. data/lib/generators/jquery/datatables/templates/foundation.scss.tt +33 -0
  108. data/lib/generators/jquery/datatables/templates/jqueryui.js.tt +7 -1
  109. data/lib/generators/jquery/datatables/templates/jqueryui.scss.tt +15 -0
  110. data/lib/generators/jquery/datatables/templates/material.js.tt +3 -1
  111. data/lib/generators/jquery/datatables/templates/material.scss.tt +1 -0
  112. data/lib/generators/jquery/datatables/templates/regular.js.tt +4 -3
  113. data/lib/generators/jquery/datatables/templates/regular.scss.tt +33 -0
  114. data/lib/generators/jquery/datatables/templates/semanticui.js.tt +4 -2
  115. data/lib/generators/jquery/datatables/templates/semanticui.scss.tt +15 -0
  116. data/lib/generators/jquery/datatables/templates/uikit.js.tt +4 -2
  117. data/lib/generators/jquery/datatables/templates/uikit.scss.tt +1 -0
  118. data/lib/jquery-datatables/version.rb +1 -1
  119. metadata +86 -90
  120. data/app/assets/stylesheets/datatables/dataTables.bootstrap.css +0 -184
  121. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.css +0 -194
  122. data/app/assets/stylesheets/datatables/dataTables.foundation.css +0 -118
  123. data/app/assets/stylesheets/datatables/dataTables.jqueryui.css +0 -482
  124. data/app/assets/stylesheets/datatables/dataTables.material.css +0 -87
  125. data/app/assets/stylesheets/datatables/dataTables.semanticui.css +0 -102
  126. data/app/assets/stylesheets/datatables/dataTables.uikit.css +0 -146
  127. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.css +0 -81
  128. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.css +0 -81
  129. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.css +0 -92
  130. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.foundation.css +0 -85
  131. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.jqueryui.css +0 -85
  132. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.semanticui.css +0 -81
  133. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.css +0 -158
  134. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.css +0 -219
  135. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.css +0 -354
  136. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.css +0 -189
  137. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.css +0 -218
  138. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.css +0 -171
  139. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap.css +0 -11
  140. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap4.css +0 -11
  141. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.dataTables.css +0 -11
  142. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.foundation.css +0 -11
  143. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.jqueryui.css +0 -11
  144. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.semanticui.css +0 -11
  145. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.css +0 -44
  146. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.css +0 -44
  147. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.dataTables.css +0 -18
  148. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.jqueryui.css +0 -8
  149. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.semanticui.css +0 -16
  150. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.dataTables.css +0 -19
  151. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.jqueryui.css +0 -15
  152. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.css +0 -5
  153. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.css +0 -5
  154. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.css +0 -5
  155. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.css +0 -5
  156. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.jqueryui.css +0 -5
  157. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.css +0 -5
  158. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap.css +0 -181
  159. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap4.css +0 -181
  160. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.dataTables.css +0 -178
  161. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.foundation.css +0 -181
  162. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.jqueryui.css +0 -178
  163. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.semanticui.css +0 -181
  164. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap.css +0 -4
  165. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap4.css +0 -4
  166. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.css +0 -4
  167. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.foundation.css +0 -4
  168. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.jqueryui.css +0 -4
  169. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.semanticui.css +0 -4
  170. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap.css +0 -22
  171. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap4.css +0 -22
  172. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.dataTables.css +0 -22
  173. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.foundation.css +0 -22
  174. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.jqueryui.css +0 -22
  175. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.semanticui.css +0 -22
  176. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.css +0 -24
  177. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.css +0 -24
  178. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.css +0 -20
  179. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.foundation.css +0 -17
  180. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.jqueryui.css +0 -20
  181. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.semanticui.css +0 -20
  182. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.css +0 -115
  183. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.css +0 -115
  184. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.css +0 -105
  185. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.css +0 -117
  186. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.css +0 -105
  187. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.css +0 -110
  188. data/app/assets/stylesheets/datatables/jquery.dataTables.css +0 -455
  189. data/app/assets/stylesheets/datatables/jquery.dataTables_themeroller.css +0 -416
  190. data/lib/generators/jquery/datatables/templates/bootstrap.css.tt +0 -15
  191. data/lib/generators/jquery/datatables/templates/bootstrap2.css.tt +0 -15
  192. data/lib/generators/jquery/datatables/templates/bootstrap2.js.tt +0 -22
  193. data/lib/generators/jquery/datatables/templates/bootstrap4.css.tt +0 -15
  194. data/lib/generators/jquery/datatables/templates/foundation.css.tt +0 -15
  195. data/lib/generators/jquery/datatables/templates/jqueryui.css.tt +0 -15
  196. data/lib/generators/jquery/datatables/templates/material.css.tt +0 -15
  197. data/lib/generators/jquery/datatables/templates/regular.css.tt +0 -15
  198. data/lib/generators/jquery/datatables/templates/semanticui.css.tt +0 -16
  199. data/lib/generators/jquery/datatables/templates/uikit.css.tt +0 -15
@@ -65,7 +65,7 @@ _display.modal = function ( options ) {
65
65
  header
66
66
  .empty()
67
67
  .append( '<h4 class="modal-title">'+options.header( row )+'</h4>' )
68
- .prepend( button );
68
+ .append( button );
69
69
  }
70
70
 
71
71
  _modal.find( 'div.modal-body' )
@@ -1,11 +1,11 @@
1
- /*! RowGroup 1.0.0
1
+ /*! RowGroup 1.0.2
2
2
  * ©2017 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary RowGroup
7
7
  * @description RowGrouping for DataTables
8
- * @version 1.0.0
8
+ * @version 1.0.2
9
9
  * @file dataTables.rowGroup.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact datatables.net
@@ -68,7 +68,7 @@ var RowGroup = function ( dt, opts ) {
68
68
  this.s = {
69
69
  dt: new DataTable.Api( dt ),
70
70
 
71
- dataFn: DataTable.ext.oApi._fnGetObjectDataFn( this.c.dataSrc ),
71
+ dataFn: DataTable.ext.oApi._fnGetObjectDataFn( this.c.dataSrc )
72
72
  };
73
73
 
74
74
  // DOM items
@@ -153,7 +153,7 @@ $.extend( RowGroup.prototype, {
153
153
  }
154
154
  } );
155
155
 
156
- dt.on( 'column-visibility.dtrg', function () {
156
+ dt.on( 'column-visibility.dt.dtrg responsive-resize.dt.dtrg', function () {
157
157
  that._adjustColspan();
158
158
  } );
159
159
 
@@ -183,7 +183,9 @@ $.extend( RowGroup.prototype, {
183
183
  */
184
184
  _colspan: function ()
185
185
  {
186
- return $( this.s.dt.columns().header() ).filter(':visible').length;
186
+ return this.s.dt.columns().visible().reduce( function (a, b) {
187
+ return a + b;
188
+ }, 0 );
187
189
  },
188
190
 
189
191
  /**
@@ -321,7 +323,7 @@ RowGroup.defaults = {
321
323
  };
322
324
 
323
325
 
324
- RowGroup.version = "1.0.0";
326
+ RowGroup.version = "1.0.2";
325
327
 
326
328
 
327
329
  $.fn.dataTable.RowGroup = RowGroup;
@@ -1,15 +1,15 @@
1
- /*! RowReorder 1.2.0
2
- * 2015-2016 SpryMedia Ltd - datatables.net/license
1
+ /*! RowReorder 1.2.3
2
+ * 2015-2017 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary RowReorder
7
7
  * @description Row reordering extension for DataTables
8
- * @version 1.2.0
8
+ * @version 1.2.3
9
9
  * @file dataTables.rowReorder.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact www.sprymedia.co.uk/contact
12
- * @copyright Copyright 2015-2016 SpryMedia Ltd.
12
+ * @copyright Copyright 2015-2017 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
@@ -118,7 +118,13 @@ var RowReorder = function ( dt, opts ) {
118
118
  },
119
119
 
120
120
  /** @type {integer} Window height cached value */
121
- windowHeight: 0
121
+ windowHeight: 0,
122
+
123
+ /** @type {integer} Document outer height cached value */
124
+ documentOuterHeight: 0,
125
+
126
+ /** @type {integer} DOM clone outer height cached value */
127
+ domCloneOuterHeight: 0
122
128
  };
123
129
 
124
130
  // DOM items
@@ -170,14 +176,20 @@ $.extend( RowReorder.prototype, {
170
176
  // Use `table().container()` rather than just the table node for IE8 -
171
177
  // otherwise it only works once...
172
178
  $(dt.table().container()).on( 'mousedown.rowReorder touchstart.rowReorder', this.c.selector, function (e) {
173
- if ( ! that.c.enabled ) {
179
+ if ( ! that.c.enable ) {
174
180
  return;
175
181
  }
176
182
 
177
183
  var tr = $(this).closest('tr');
184
+ var row = dt.row( tr );
178
185
 
179
186
  // Double check that it is a DataTable row
180
- if ( dt.row( tr ).any() ) {
187
+ if ( row.any() ) {
188
+ that._emitEvent( 'pre-row-reorder', {
189
+ node: row.node(),
190
+ index: row.index()
191
+ } );
192
+
181
193
  that._mouseDown( e, tr );
182
194
  return false;
183
195
  }
@@ -226,6 +238,7 @@ $.extend( RowReorder.prototype, {
226
238
  this.s.middles = middles;
227
239
  this.s.bodyTop = $( dt.table().body() ).offset().top;
228
240
  this.s.windowHeight = $(window).height();
241
+ this.s.documentOuterHeight = $(document).outerHeight();
229
242
  },
230
243
 
231
244
 
@@ -262,6 +275,7 @@ $.extend( RowReorder.prototype, {
262
275
  clone.appendTo( 'body' );
263
276
 
264
277
  this.dom.clone = clone;
278
+ this.s.domCloneOuterHeight = clone.outerHeight();
265
279
  },
266
280
 
267
281
 
@@ -278,6 +292,7 @@ $.extend( RowReorder.prototype, {
278
292
  var leftDiff = this._eventToPage( e, 'X' ) - start.left;
279
293
  var snap = this.c.snapX;
280
294
  var left;
295
+ var top = topDiff + start.offsetTop;
281
296
 
282
297
  if ( snap === true ) {
283
298
  left = start.offsetLeft;
@@ -289,8 +304,15 @@ $.extend( RowReorder.prototype, {
289
304
  left = leftDiff + start.offsetLeft;
290
305
  }
291
306
 
307
+ if(top < 0) {
308
+ top = 0
309
+ }
310
+ else if(top + this.s.domCloneOuterHeight > this.s.documentOuterHeight) {
311
+ top = this.s.documentOuterHeight - this.s.domCloneOuterHeight;
312
+ }
313
+
292
314
  this.dom.clone.css( {
293
- top: topDiff + start.offsetTop,
315
+ top: top,
294
316
  left: left
295
317
  } );
296
318
  },
@@ -510,10 +532,33 @@ $.extend( RowReorder.prototype, {
510
532
  // Emit event
511
533
  this._emitEvent( 'row-reorder', eventArgs );
512
534
 
535
+ var update = function () {
536
+ if ( that.c.update ) {
537
+ for ( i=0, ien=fullDiff.length ; i<ien ; i++ ) {
538
+ var row = dt.row( fullDiff[i].node );
539
+ var rowData = row.data();
540
+
541
+ setDataFn( rowData, fullDiff[i].newData );
542
+
543
+ // Invalidate the cell that has the same data source as the dataSrc
544
+ dt.columns().every( function () {
545
+ if ( this.dataSrc() === dataSrc ) {
546
+ dt.cell( fullDiff[i].node, this.index() ).invalidate( 'data' );
547
+ }
548
+ } );
549
+ }
550
+
551
+ // Trigger row reordered event
552
+ that._emitEvent( 'row-reordered', eventArgs );
553
+
554
+ dt.draw( false );
555
+ }
556
+ };
557
+
513
558
  // Editor interface
514
559
  if ( this.c.editor ) {
515
560
  // Disable user interaction while Editor is submitting
516
- this.c.enabled = false;
561
+ this.c.enable = false;
517
562
 
518
563
  this.c.editor
519
564
  .edit(
@@ -522,32 +567,20 @@ $.extend( RowReorder.prototype, {
522
567
  $.extend( {submit: 'changed'}, this.c.formOptions )
523
568
  )
524
569
  .multiSet( dataSrc, idDiff )
570
+ .one( 'submitUnsuccessful.rowReorder', function () {
571
+ dt.draw( false );
572
+ } )
573
+ .one( 'submitSuccess.rowReorder', function () {
574
+ update();
575
+ } )
525
576
  .one( 'submitComplete', function () {
526
- that.c.enabled = true;
577
+ that.c.enable = true;
578
+ that.c.editor.off( '.rowReorder' );
527
579
  } )
528
580
  .submit();
529
581
  }
530
-
531
- // Do update if required
532
- if ( this.c.update ) {
533
- for ( i=0, ien=fullDiff.length ; i<ien ; i++ ) {
534
- var row = dt.row( fullDiff[i].node );
535
- var rowData = row.data();
536
-
537
- setDataFn( rowData, fullDiff[i].newData );
538
-
539
- // Invalidate the cell that has the same data source as the dataSrc
540
- dt.columns().every( function () {
541
- if ( this.dataSrc() === dataSrc ) {
542
- dt.cell( fullDiff[i].node, this.index() ).invalidate( 'data' );
543
- }
544
- } );
545
- }
546
-
547
- // Trigger row reordered event
548
- this._emitEvent( 'row-reordered', eventArgs );
549
-
550
- dt.draw( false );
582
+ else {
583
+ update();
551
584
  }
552
585
  },
553
586
 
@@ -664,7 +697,7 @@ RowReorder.defaults = {
664
697
  * Enable / disable RowReorder's user interaction
665
698
  * @type {Boolean}
666
699
  */
667
- enabled: true,
700
+ enable: true,
668
701
 
669
702
  /**
670
703
  * Form options to pass to Editor when submitting a change in the row order.
@@ -717,7 +750,7 @@ Api.register( 'rowReorder.enable()', function ( toggle ) {
717
750
 
718
751
  return this.iterator( 'table', function ( ctx ) {
719
752
  if ( ctx.rowreorder ) {
720
- ctx.rowreorder.c.enabled = toggle;
753
+ ctx.rowreorder.c.enable = toggle;
721
754
  }
722
755
  } );
723
756
  } );
@@ -725,7 +758,7 @@ Api.register( 'rowReorder.enable()', function ( toggle ) {
725
758
  Api.register( 'rowReorder.disable()', function () {
726
759
  return this.iterator( 'table', function ( ctx ) {
727
760
  if ( ctx.rowreorder ) {
728
- ctx.rowreorder.c.enabled = false;
761
+ ctx.rowreorder.c.enable = false;
729
762
  }
730
763
  } );
731
764
  } );
@@ -737,7 +770,7 @@ Api.register( 'rowReorder.disable()', function () {
737
770
  * @name RowReorder.version
738
771
  * @static
739
772
  */
740
- RowReorder.version = '1.2.0';
773
+ RowReorder.version = '1.2.3';
741
774
 
742
775
 
743
776
  $.fn.dataTable.RowReorder = RowReorder;
@@ -1,15 +1,15 @@
1
- /*! Scroller 1.4.2
2
- * ©2011-2016 SpryMedia Ltd - datatables.net/license
1
+ /*! Scroller 1.4.3
2
+ * ©2011-2017 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary Scroller
7
7
  * @description Virtual rendering for DataTables
8
- * @version 1.4.2
8
+ * @version 1.4.3
9
9
  * @file dataTables.scroller.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact www.sprymedia.co.uk/contact
12
- * @copyright Copyright 2011-2016 SpryMedia Ltd.
12
+ * @copyright Copyright 2011-2017 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
@@ -210,7 +210,8 @@ var Scroller = function ( dt, opts ) {
210
210
 
211
211
  topRowFloat: 0,
212
212
  scrollDrawDiff: null,
213
- loaderVisible: false
213
+ loaderVisible: false,
214
+ forceReposition: false
214
215
  };
215
216
 
216
217
  // @todo The defaults should extend a `c` property and the internal settings
@@ -371,6 +372,14 @@ $.extend( Scroller.prototype, {
371
372
  if ( (px > this.s.redrawBottom || px < this.s.redrawTop) && this.s.dt._iDisplayStart !== drawRow ) {
372
373
  ani = true;
373
374
  px = this.fnRowToPixels( iRow, false, true );
375
+
376
+ // If we need records outside the current draw region, but the new
377
+ // scrolling position is inside that (due to the non-linear nature
378
+ // for larger numbers of records), we need to force position update.
379
+ if ( this.s.redrawTop < px && px < this.s.redrawBottom ) {
380
+ this.s.forceReposition = true;
381
+ bAnimate = false;
382
+ }
374
383
  }
375
384
 
376
385
  if ( typeof bAnimate == 'undefined' || bAnimate )
@@ -432,7 +441,15 @@ $.extend( Scroller.prototype, {
432
441
  var heights = this.s.heights;
433
442
 
434
443
  if ( heights.row ) {
435
- heights.viewport = $(this.dom.scroller).height();
444
+ heights.viewport = $.contains(document, this.dom.scroller) ?
445
+ $(this.dom.scroller).height() :
446
+ this._parseHeight($(this.dom.scroller).css('height'));
447
+
448
+ // If collapsed (no height) use the max-height parameter
449
+ if ( ! heights.viewport ) {
450
+ heights.viewport = this._parseHeight($(this.dom.scroller).css('max-height'));
451
+ }
452
+
436
453
  this.s.viewportRows = parseInt( heights.viewport / heights.row, 10 )+1;
437
454
  this.s.dt._iDisplayLength = this.s.viewportRows * this.s.displayBuffer;
438
455
  }
@@ -656,10 +673,11 @@ $.extend( Scroller.prototype, {
656
673
  /* Check if the scroll point is outside the trigger boundary which would required
657
674
  * a DataTables redraw
658
675
  */
659
- if ( iScrollTop < this.s.redrawTop || iScrollTop > this.s.redrawBottom ) {
676
+ if ( this.s.forceReposition || iScrollTop < this.s.redrawTop || iScrollTop > this.s.redrawBottom ) {
677
+
660
678
  var preRows = Math.ceil( ((this.s.displayBuffer-1)/2) * this.s.viewportRows );
661
679
 
662
- if ( Math.abs( iScrollTop - this.s.lastScrollTop ) > heights.viewport || this.s.ani ) {
680
+ if ( Math.abs( iScrollTop - this.s.lastScrollTop ) > heights.viewport || this.s.ani || this.s.forceReposition ) {
663
681
  iTopRow = parseInt(this._domain( 'physicalToVirtual', iScrollTop ) / heights.row, 10) - preRows;
664
682
  this.s.topRowFloat = this._domain( 'physicalToVirtual', iScrollTop ) / heights.row;
665
683
  }
@@ -668,6 +686,8 @@ $.extend( Scroller.prototype, {
668
686
  this.s.topRowFloat = this.fnPixelsToRow( iScrollTop, false );
669
687
  }
670
688
 
689
+ this.s.forceReposition = false;
690
+
671
691
  if ( iTopRow <= 0 ) {
672
692
  /* At the start of the table */
673
693
  iTopRow = 0;
@@ -783,6 +803,45 @@ $.extend( Scroller.prototype, {
783
803
  }
784
804
  },
785
805
 
806
+ /**
807
+ * Parse CSS height property string as number
808
+ *
809
+ * An attempt is made to parse the string as a number. Currently supported units are 'px',
810
+ * 'vh', and 'rem'. 'em' is partially supported; it works as long as the parent element's
811
+ * font size matches the body element. Zero is returned for unrecognized strings.
812
+ * @param {string} cssHeight CSS height property string
813
+ * @returns {number} height
814
+ * @private
815
+ */
816
+ _parseHeight: function(cssHeight) {
817
+ var height;
818
+ var matches = /^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(px|em|rem|vh)$/.exec(cssHeight);
819
+
820
+ if (matches === null) {
821
+ return 0;
822
+ }
823
+
824
+ var value = parseFloat(matches[1]);
825
+ var unit = matches[2];
826
+
827
+ if ( unit === 'px' ) {
828
+ height = value;
829
+ }
830
+ else if ( unit === 'vh' ) {
831
+ height = ( value / 100 ) * $(window).height();
832
+ }
833
+ else if ( unit === 'rem' ) {
834
+ height = value * parseFloat($(':root').css('font-size'));
835
+ }
836
+ else if ( unit === 'em' ) {
837
+ height = value * parseFloat($('body').css('font-size'));
838
+ }
839
+
840
+ return height ?
841
+ height :
842
+ 0;
843
+ },
844
+
786
845
 
787
846
  /**
788
847
  * Draw callback function which is fired when the DataTable is redrawn. The main function of
@@ -850,7 +909,9 @@ $.extend( Scroller.prototype, {
850
909
  // scroll event listener
851
910
  var boundaryPx = (iScrollTop - this.s.tableTop) * this.s.boundaryScale;
852
911
  this.s.redrawTop = iScrollTop - boundaryPx;
853
- this.s.redrawBottom = iScrollTop + boundaryPx;
912
+ this.s.redrawBottom = iScrollTop + boundaryPx > heights.scroll - heights.viewport - heights.row ?
913
+ heights.scroll - heights.viewport - heights.row :
914
+ iScrollTop + boundaryPx;
854
915
 
855
916
  this.s.skip = false;
856
917
 
@@ -1217,7 +1278,7 @@ Scroller.oDefaults = Scroller.defaults;
1217
1278
  * @name Scroller.version
1218
1279
  * @static
1219
1280
  */
1220
- Scroller.version = "1.4.2";
1281
+ Scroller.version = "1.4.3";
1221
1282
 
1222
1283
 
1223
1284
 
@@ -1,16 +1,16 @@
1
- /*! Select for DataTables 1.2.2
2
- * 2015-2016 SpryMedia Ltd - datatables.net/license/mit
1
+ /*! Select for DataTables 1.2.3
2
+ * 2015-2017 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.2
9
+ * @version 1.2.3
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-2016 SpryMedia Ltd.
13
+ * @copyright Copyright 2015-2017 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.2';
57
+ DataTable.select.version = '1.2.3';
58
58
 
59
59
  DataTable.select.init = function ( dt ) {
60
60
  var ctx = dt.settings()[0];
@@ -401,8 +401,8 @@ function enableMouseSelection ( dt )
401
401
 
402
402
  // Ignore elements which have been removed from the DOM (i.e. paging
403
403
  // buttons)
404
- if ( e.target.getRootNode() !== document ) {
405
- return;
404
+ if ( $(e.target).parents('html').length === 0 ) {
405
+ return;
406
406
  }
407
407
 
408
408
  // Don't blur in Editor form
@@ -455,6 +455,10 @@ function info ( api )
455
455
  return;
456
456
  }
457
457
 
458
+ if ( api.select.style() === 'api' ) {
459
+ return;
460
+ }
461
+
458
462
  var rows = api.rows( { selected: true } ).flatten().length;
459
463
  var columns = api.columns( { selected: true } ).flatten().length;
460
464
  var cells = api.cells( { selected: true } ).flatten().length;