datatables.net-responsive
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -1,2 +0,2 @@ | ||
/*! Responsive 2.0.2 | ||
/*! Responsive 2.1.0 | ||
* 2014-2016 SpryMedia Ltd - datatables.net/license | ||
@@ -8,3 +8,3 @@ */ | ||
* @description Responsive tables plug-in for DataTables | ||
* @version 2.0.2 | ||
* @version 2.1.0 | ||
* @file dataTables.responsive.js | ||
@@ -236,2 +236,3 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
dt.on( 'column-sizing.dtr', function () { | ||
that._resizeAuto(); | ||
that._resize(); | ||
@@ -546,3 +547,3 @@ }); | ||
if ( details && details.type ) { | ||
if ( details && details.type !== false ) { | ||
var res = details.display( row, update, function () { | ||
@@ -652,3 +653,4 @@ return details.renderer( | ||
return $.map( this.s.columns, function( col, i ) { | ||
if ( col.never ) { | ||
// Never and control columns should not be passed to the renderer | ||
if ( col.never || col.control ) { | ||
return; | ||
@@ -819,3 +821,3 @@ } | ||
var footerCells = dt.columns() | ||
.header() | ||
.footer() | ||
.filter( function (idx) { | ||
@@ -843,3 +845,8 @@ return dt.column(idx).visible(); | ||
} | ||
// It is unsafe to insert elements with the same name into the DOM | ||
// multiple times. For example, cloning and inserting a checked radio | ||
// clears the chcecked state of the original radio. | ||
$( clonedTable ).find( '[name]' ).removeAttr( 'name' ); | ||
var inserted = $('<div/>') | ||
@@ -1040,2 +1047,50 @@ .css( { | ||
/** | ||
* Display methods - functions which define how the hidden data should be shown | ||
* in the table. | ||
* | ||
* @namespace | ||
* @name Responsive.defaults | ||
* @static | ||
*/ | ||
Responsive.renderer = { | ||
listHidden: function () { | ||
return function ( api, rowIdx, columns ) { | ||
var data = $.map( columns, function ( col ) { | ||
return col.hidden ? | ||
'<li data-dtr-index="'+col.columnIndex+'" data-dt-row="'+col.rowIndex+'" data-dt-column="'+col.columnIndex+'">'+ | ||
'<span class="dtr-title">'+ | ||
col.title+ | ||
'</span> '+ | ||
'<span class="dtr-data">'+ | ||
col.data+ | ||
'</span>'+ | ||
'</li>' : | ||
''; | ||
} ).join(''); | ||
return data ? | ||
$('<ul data-dtr-index="'+rowIdx+'"/>').append( data ) : | ||
false; | ||
} | ||
}, | ||
tableAll: function ( options ) { | ||
options = $.extend( { | ||
tableClass: '' | ||
}, options ); | ||
return function ( api, rowIdx, columns ) { | ||
var data = $.map( columns, function ( col ) { | ||
return '<tr data-dt-row="'+col.rowIndex+'" data-dt-column="'+col.columnIndex+'">'+ | ||
'<td>'+col.title+':'+'</td> '+ | ||
'<td>'+col.data+'</td>'+ | ||
'</tr>'; | ||
} ).join(''); | ||
return $('<table class="'+options.tableClass+'" width="100%"/>').append( data ); | ||
} | ||
} | ||
}; | ||
/** | ||
* Responsive default settings for initialisation | ||
@@ -1088,21 +1143,4 @@ * | ||
renderer: function ( api, rowIdx, columns ) { | ||
var data = $.map( columns, function ( col, i ) { | ||
return col.hidden ? | ||
'<li data-dtr-index="'+col.columnIndex+'" data-dt-row="'+col.rowIndex+'" data-dt-column="'+col.columnIndex+'">'+ | ||
'<span class="dtr-title">'+ | ||
col.title+ | ||
'</span> '+ | ||
'<span class="dtr-data">'+ | ||
col.data+ | ||
'</span>'+ | ||
'</li>' : | ||
''; | ||
} ).join(''); | ||
renderer: Responsive.renderer.listHidden(), | ||
return data ? | ||
$('<ul data-dtr-index="'+rowIdx+'"/>').append( data ) : | ||
false; | ||
}, | ||
target: 0, | ||
@@ -1174,3 +1212,3 @@ | ||
*/ | ||
Responsive.version = '2.0.2'; | ||
Responsive.version = '2.1.0'; | ||
@@ -1177,0 +1215,0 @@ |
{ | ||
"name": "datatables.net-responsive", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Responsive for DataTables ", | ||
@@ -26,3 +26,7 @@ "files": [ | ||
"datatables.net": ">=1.10.9" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DataTables/Dist-DataTables-Responsive.git" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
37561
101085
1061
0