Merge branch 'master' of github.com:DataTables/Plugins

pull/499/head
SandyDataTables 4 years ago
commit e081c863a4

@ -43,7 +43,12 @@
return; return;
} }
var options = dtSettings.oInit.conditionalPageLength || $.fn.dataTable.defaults.conditionalPageLength; var options = dtSettings.oInit.conditionalPageLength || $.fn.dataTable.defaults.conditionalPageLength,
lengthMenu = dtSettings.aLengthMenu || $.fn.dataTable.defaults.lengthMenu,
lengthMenuValues = Array.isArray(lengthMenu[0]) ? lengthMenu[0] : lengthMenu;
lengthMenuValues = lengthMenuValues.filter(function(n) { return n > 0 });
var smallestLength = Math.min.apply(Math, lengthMenuValues);
if ($.isPlainObject(options) || options === true) { if ($.isPlainObject(options) || options === true) {
var config = $.isPlainObject(options) ? options : {}, var config = $.isPlainObject(options) ? options : {},
@ -55,7 +60,7 @@
size = api.rows({search:'applied'}).count(); size = api.rows({search:'applied'}).count();
if (e instanceof $.Event) { if (e instanceof $.Event) {
if (pages <= 1) { if (pages <= 1 && size <= smallestLength) {
if (config.style === 'fade') { if (config.style === 'fade') {
$paging.stop().fadeTo(speed, 0); $paging.stop().fadeTo(speed, 0);
} }
@ -72,7 +77,7 @@
} }
} }
} }
else if (pages <= 1) { else if (pages <= 1 && size <= smallestLength) {
if (config.style === 'fade') { if (config.style === 'fade') {
$paging.css('opacity', 0); $paging.css('opacity', 0);
} }

Loading…
Cancel
Save