datatables.net-responsive
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -1,2 +0,2 @@ | ||
/*! Responsive 2.1.0 | ||
/*! Responsive 2.1.1 | ||
* 2014-2016 SpryMedia Ltd - datatables.net/license | ||
@@ -8,3 +8,3 @@ */ | ||
* @description Responsive tables plug-in for DataTables | ||
* @version 2.1.0 | ||
* @version 2.1.1 | ||
* @file dataTables.responsive.js | ||
@@ -170,3 +170,3 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
if ( $.inArray( false, that.s.current ) !== -1 ) { | ||
$('td, th', tr).each( function ( i ) { | ||
$('>td, >th', tr).each( function ( i ) { | ||
var idx = dt.column.index( 'toData', i ); | ||
@@ -241,2 +241,19 @@ | ||
// On Ajax reload we want to reopen any child rows which are displayed | ||
// by responsive | ||
dt.on( 'preXhr.dtr', function () { | ||
var rowIds = []; | ||
dt.rows().every( function () { | ||
if ( this.child.isShown() ) { | ||
rowIds.push( this.id(true) ); | ||
} | ||
} ); | ||
dt.one( 'draw.dtr', function () { | ||
dt.rows( rowIds ).every( function () { | ||
that._detailsDisplay( this, false ); | ||
} ); | ||
} ); | ||
}); | ||
dt.on( 'init.dtr', function (e, settings, details) { | ||
@@ -604,3 +621,3 @@ that._resizeAuto(); | ||
// Check that the row is actually a DataTable's controlled node | ||
if ( ! dt.row( $(this).closest('tr') ).length ) { | ||
if ( $.inArray( $(this).closest('tr').get(0), dt.rows().nodes().toArray() ) === -1 ) { | ||
return; | ||
@@ -914,2 +931,8 @@ } | ||
// This is a bit of a hack - we need to limit the selected nodes to just | ||
// those of this table | ||
if ( selector === 'td:first-child, th:first-child' ) { | ||
selector = '>td:first-child, >th:first-child'; | ||
} | ||
$( selector, dt.rows( { page: 'current' } ).nodes() ) | ||
@@ -1070,3 +1093,3 @@ .attr( 'tabIndex', ctx.iTabIndex ) | ||
return data ? | ||
$('<ul data-dtr-index="'+rowIdx+'"/>').append( data ) : | ||
$('<ul data-dtr-index="'+rowIdx+'" class="dtr-details"/>').append( data ) : | ||
false; | ||
@@ -1089,3 +1112,3 @@ } | ||
return $('<table class="'+options.tableClass+'" width="100%"/>').append( data ); | ||
return $('<table class="'+options.tableClass+' dtr-details" width="100%"/>').append( data ); | ||
} | ||
@@ -1211,3 +1234,3 @@ } | ||
*/ | ||
Responsive.version = '2.1.0'; | ||
Responsive.version = '2.1.1'; | ||
@@ -1214,0 +1237,0 @@ |
{ | ||
"name": "datatables.net-responsive", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Responsive for DataTables ", | ||
@@ -5,0 +5,0 @@ "files": [ |
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
38257
1081