datatables.net 2.0.6 → 2.0.8

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! DataTables 2.0.6
1
+ /*! DataTables 2.0.8
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -4777,7 +4777,7 @@ function _processingHtml ( settings )
4777
4777
 
4778
4778
  // Different positioning depending on if scrolling is enabled or not
4779
4779
  if (scrolling) {
4780
- n.prependTo( 'div.dt-scroll', settings.nTableWrapper );
4780
+ n.prependTo( $('div.dt-scroll', settings.nTableWrapper) );
4781
4781
  }
4782
4782
  else {
4783
4783
  n.insertBefore( table );
@@ -5026,7 +5026,7 @@ function _fnScrollDraw ( settings )
5026
5026
  // of the indexes out.
5027
5027
  if (settings.aiDisplay.length) {
5028
5028
  // Get the column sizes from the first row in the table
5029
- var colSizes = table.children('tbody > tr').eq(0).children('th, td').map(function (vis) {
5029
+ var colSizes = table.children('tbody').eq(0).children('tr').eq(0).children('th, td').map(function (vis) {
5030
5030
  return {
5031
5031
  idx: _fnVisibleToColumnIndex(settings, vis),
5032
5032
  width: $(this).outerWidth()
@@ -7507,6 +7507,16 @@ var _selector_row_indexes = function ( settings, opts )
7507
7507
  order = opts.order, // applied, current, index (original - compatibility with 1.9)
7508
7508
  page = opts.page; // all, current
7509
7509
 
7510
+ if ( _fnDataSource( settings ) == 'ssp' ) {
7511
+ // In server-side processing mode, most options are irrelevant since
7512
+ // rows not shown don't exist and the index order is the applied order
7513
+ // Removed is a special case - for consistency just return an empty
7514
+ // array
7515
+ return search === 'removed' ?
7516
+ [] :
7517
+ _range( 0, displayMaster.length );
7518
+ }
7519
+
7510
7520
  if ( page == 'current' ) {
7511
7521
  // Current page implies that order=current and filter=applied, since it is
7512
7522
  // fairly senseless otherwise, regardless of what order and search actually
@@ -8178,7 +8188,7 @@ _api_register( [
8178
8188
  _api_register( _child_obj+'.isShown()', function () {
8179
8189
  var ctx = this.context;
8180
8190
 
8181
- if ( ctx.length && this.length ) {
8191
+ if ( ctx.length && this.length && ctx[0].aoData[ this[0] ] ) {
8182
8192
  // _detailsShown as false or undefined will fall through to return false
8183
8193
  return ctx[0].aoData[ this[0] ]._detailsShow || false;
8184
8194
  }
@@ -8201,7 +8211,7 @@ _api_register( _child_obj+'.isShown()', function () {
8201
8211
  // can be an array of these items, comma separated list, or an array of comma
8202
8212
  // separated lists
8203
8213
 
8204
- var __re_column_selector = /^([^:]+):(name|title|visIdx|visible)$/;
8214
+ var __re_column_selector = /^([^:]+)?:(name|title|visIdx|visible)$/;
8205
8215
 
8206
8216
 
8207
8217
  // r1 and r2 are redundant - but it means that the parameters match for the
@@ -8273,17 +8283,24 @@ var __column_selector = function ( settings, selector, opts )
8273
8283
  switch( match[2] ) {
8274
8284
  case 'visIdx':
8275
8285
  case 'visible':
8276
- var idx = parseInt( match[1], 10 );
8277
- // Visible index given, convert to column index
8278
- if ( idx < 0 ) {
8279
- // Counting from the right
8280
- var visColumns = columns.map( function (col,i) {
8281
- return col.bVisible ? i : null;
8282
- } );
8283
- return [ visColumns[ visColumns.length + idx ] ];
8286
+ if (match[1]) {
8287
+ var idx = parseInt( match[1], 10 );
8288
+ // Visible index given, convert to column index
8289
+ if ( idx < 0 ) {
8290
+ // Counting from the right
8291
+ var visColumns = columns.map( function (col,i) {
8292
+ return col.bVisible ? i : null;
8293
+ } );
8294
+ return [ visColumns[ visColumns.length + idx ] ];
8295
+ }
8296
+ // Counting from the left
8297
+ return [ _fnVisibleToColumnIndex( settings, idx ) ];
8284
8298
  }
8285
- // Counting from the left
8286
- return [ _fnVisibleToColumnIndex( settings, idx ) ];
8299
+
8300
+ // `:visible` on its own
8301
+ return columns.map( function (col, i) {
8302
+ return col.bVisible ? i : null;
8303
+ } );
8287
8304
 
8288
8305
  case 'name':
8289
8306
  // match by name. `names` is column index complete and in order
@@ -9558,7 +9575,7 @@ _api_register( 'i18n()', function ( token, def, plural ) {
9558
9575
  * @type string
9559
9576
  * @default Version number
9560
9577
  */
9561
- DataTable.version = "2.0.6";
9578
+ DataTable.version = "2.0.8";
9562
9579
 
9563
9580
  /**
9564
9581
  * Private data store, containing all of the settings objects that are
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "js/dataTables.js",
5
5
  "module": "js/dataTables.mjs",
6
6
  "types": "./types/types.d.ts",
7
- "version": "2.0.6",
7
+ "version": "2.0.8",
8
8
  "files": [
9
9
  "js/**/*.js",
10
10
  "js/**/*.mjs",