datatables.net 2.1.4 → 2.1.5
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.js +62 -21
- package/js/dataTables.min.js +2 -2
- package/js/dataTables.min.mjs +2 -2
- package/js/dataTables.mjs +61 -20
- package/package.json +1 -1
package/js/dataTables.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! DataTables 2.1.
|
|
1
|
+
/*! DataTables 2.1.5
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -1000,7 +1000,8 @@ $.extend( DataTable.ext.classes, {
|
|
|
1000
1000
|
active: 'current',
|
|
1001
1001
|
button: 'dt-paging-button',
|
|
1002
1002
|
container: 'dt-paging',
|
|
1003
|
-
disabled: 'disabled'
|
|
1003
|
+
disabled: 'disabled',
|
|
1004
|
+
nav: ''
|
|
1004
1005
|
}
|
|
1005
1006
|
} );
|
|
1006
1007
|
|
|
@@ -2102,7 +2103,11 @@ function _fnColumnSizes ( settings )
|
|
|
2102
2103
|
for (var i=0 ; i<cols.length ; i++) {
|
|
2103
2104
|
var width = _fnColumnsSumWidth(settings, [i], false, false);
|
|
2104
2105
|
|
|
2105
|
-
|
|
2106
|
+
// Need to set the min-width, otherwise the browser might try to collapse
|
|
2107
|
+
// it further
|
|
2108
|
+
cols[i].colEl
|
|
2109
|
+
.css('width', width)
|
|
2110
|
+
.css('min-width', width);
|
|
2106
2111
|
}
|
|
2107
2112
|
}
|
|
2108
2113
|
|
|
@@ -3068,6 +3073,9 @@ function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
|
|
|
3068
3073
|
_fnWriteCell(nTd, display[i]);
|
|
3069
3074
|
}
|
|
3070
3075
|
|
|
3076
|
+
// column class
|
|
3077
|
+
_addClass(nTd, oCol.sClass);
|
|
3078
|
+
|
|
3071
3079
|
// Visibility - add or remove as required
|
|
3072
3080
|
if ( oCol.bVisible && create )
|
|
3073
3081
|
{
|
|
@@ -3399,7 +3407,6 @@ function _fnDraw( oSettings, ajaxComplete )
|
|
|
3399
3407
|
var td = aoData.anCells[i];
|
|
3400
3408
|
|
|
3401
3409
|
_addClass(td, _ext.type.className[col.sType]); // auto class
|
|
3402
|
-
_addClass(td, col.sClass); // column class
|
|
3403
3410
|
_addClass(td, oSettings.oClasses.tbody.cell); // all cells
|
|
3404
3411
|
}
|
|
3405
3412
|
|
|
@@ -5173,21 +5180,37 @@ function _fnScrollDraw ( settings )
|
|
|
5173
5180
|
// is because of Responsive which might remove `col` elements, knocking the alignment
|
|
5174
5181
|
// of the indexes out.
|
|
5175
5182
|
if (settings.aiDisplay.length) {
|
|
5176
|
-
// Get the column sizes from the first row in the table
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5183
|
+
// Get the column sizes from the first row in the table. This should really be a
|
|
5184
|
+
// [].find, but it wasn't supported in Chrome until Sept 2015, and DT has 10 year
|
|
5185
|
+
// browser support
|
|
5186
|
+
var firstTr = null;
|
|
5187
|
+
|
|
5188
|
+
for (i=0 ; i<settings.aiDisplay.length ; i++) {
|
|
5189
|
+
var idx = settings.aiDisplay[i];
|
|
5190
|
+
var tr = settings.aoData[idx].nTr;
|
|
5191
|
+
|
|
5192
|
+
if (tr) {
|
|
5193
|
+
firstTr = tr;
|
|
5194
|
+
break;
|
|
5181
5195
|
}
|
|
5182
|
-
}
|
|
5196
|
+
}
|
|
5183
5197
|
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5198
|
+
if (firstTr) {
|
|
5199
|
+
var colSizes = $(firstTr).children('th, td').map(function (vis) {
|
|
5200
|
+
return {
|
|
5201
|
+
idx: _fnVisibleToColumnIndex(settings, vis),
|
|
5202
|
+
width: $(this).outerWidth()
|
|
5203
|
+
}
|
|
5204
|
+
});
|
|
5188
5205
|
|
|
5189
|
-
|
|
5190
|
-
|
|
5206
|
+
// Check against what the colgroup > col is set to and correct if needed
|
|
5207
|
+
for (var i=0 ; i<colSizes.length ; i++) {
|
|
5208
|
+
var colEl = settings.aoColumns[ colSizes[i].idx ].colEl[0];
|
|
5209
|
+
var colWidth = colEl.style.width.replace('px', '');
|
|
5210
|
+
|
|
5211
|
+
if (colWidth !== colSizes[i].width) {
|
|
5212
|
+
colEl.style.width = colSizes[i].width + 'px';
|
|
5213
|
+
}
|
|
5191
5214
|
}
|
|
5192
5215
|
}
|
|
5193
5216
|
}
|
|
@@ -5330,7 +5353,11 @@ function _fnCalculateColumnWidths ( settings )
|
|
|
5330
5353
|
var width = _fnColumnsSumWidth( settings, this, true, false );
|
|
5331
5354
|
|
|
5332
5355
|
if ( width ) {
|
|
5356
|
+
// Need to set the width and min-width, otherwise the browser
|
|
5357
|
+
// will attempt to collapse the table beyond want might have
|
|
5358
|
+
// been specified
|
|
5333
5359
|
this.style.width = width;
|
|
5360
|
+
this.style.minWidth = width;
|
|
5334
5361
|
|
|
5335
5362
|
// For scrollX we need to force the column width otherwise the
|
|
5336
5363
|
// browser will collapse it. If this width is smaller than the
|
|
@@ -6715,6 +6742,7 @@ _Api = function ( context, data )
|
|
|
6715
6742
|
return new _Api( context, data );
|
|
6716
6743
|
}
|
|
6717
6744
|
|
|
6745
|
+
var i;
|
|
6718
6746
|
var settings = [];
|
|
6719
6747
|
var ctxSettings = function ( o ) {
|
|
6720
6748
|
var a = _toSettings( o );
|
|
@@ -6724,7 +6752,7 @@ _Api = function ( context, data )
|
|
|
6724
6752
|
};
|
|
6725
6753
|
|
|
6726
6754
|
if ( Array.isArray( context ) ) {
|
|
6727
|
-
for (
|
|
6755
|
+
for ( i=0 ; i<context.length ; i++ ) {
|
|
6728
6756
|
ctxSettings( context[i] );
|
|
6729
6757
|
}
|
|
6730
6758
|
}
|
|
@@ -6739,7 +6767,16 @@ _Api = function ( context, data )
|
|
|
6739
6767
|
|
|
6740
6768
|
// Initial data
|
|
6741
6769
|
if ( data ) {
|
|
6742
|
-
|
|
6770
|
+
// Chrome can throw a max stack error if apply is called with
|
|
6771
|
+
// too large an array, but apply is faster.
|
|
6772
|
+
if (data.length < 10000) {
|
|
6773
|
+
this.push.apply(this, data);
|
|
6774
|
+
}
|
|
6775
|
+
else {
|
|
6776
|
+
for (i=0 ; i<data.length ; i++) {
|
|
6777
|
+
this.push(data[i]);
|
|
6778
|
+
}
|
|
6779
|
+
}
|
|
6743
6780
|
}
|
|
6744
6781
|
|
|
6745
6782
|
// selector
|
|
@@ -9770,7 +9807,7 @@ _api_register( 'i18n()', function ( token, def, plural ) {
|
|
|
9770
9807
|
* @type string
|
|
9771
9808
|
* @default Version number
|
|
9772
9809
|
*/
|
|
9773
|
-
DataTable.version = "2.1.
|
|
9810
|
+
DataTable.version = "2.1.5";
|
|
9774
9811
|
|
|
9775
9812
|
/**
|
|
9776
9813
|
* Private data store, containing all of the settings objects that are
|
|
@@ -13078,7 +13115,11 @@ DataTable.feature.register( 'paging', function ( settings, opts ) {
|
|
|
13078
13115
|
|
|
13079
13116
|
var host = $('<div/>')
|
|
13080
13117
|
.addClass(settings.oClasses.paging.container + (opts.type ? ' paging_' + opts.type : ''))
|
|
13081
|
-
.append(
|
|
13118
|
+
.append(
|
|
13119
|
+
$('<nav>')
|
|
13120
|
+
.attr('aria-label', 'pagination')
|
|
13121
|
+
.addClass(settings.oClasses.paging.nav)
|
|
13122
|
+
);
|
|
13082
13123
|
var draw = function () {
|
|
13083
13124
|
_pagingDraw(settings, host.children(), opts);
|
|
13084
13125
|
};
|