You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/features/conditionalPageLength/dataTables.conditionalPageL...

2 lines
1.1 KiB
JavaScript

/*! © SpryMedia Ltd, Garrett Hyder - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";$(document).on("init.dt",function(t,a){var n,s,o,l,e;"dt"===t.namespace&&(t=a.oInit.conditionalPageLength||DataTable.defaults.conditionalPageLength,e=a.aLengthMenu||DataTable.defaults.lengthMenu,e=(e=Array.isArray(e[0])?e[0]:e).filter(function(t){return 0<t}),n=Math.min.apply(Math,e),$.isPlainObject(t)||!0===t)&&(s=$.isPlainObject(t)?t:{},o=new DataTable.Api(a),l=500,void 0!==s.speed&&(l=s.speed),(e=function(t){var a=$(o.table().container()).find("div.dataTables_length"),e=o.page.info().pages,i=o.rows({search:"applied"}).count();t instanceof $.Event?e<=1&&i<=n?"fade"===s.style?a.stop().fadeTo(l,0):a.css("visibility","hidden"):"fade"===s.style?a.stop().fadeTo(l,1):a.css("visibility",""):e<=1&&i<=n&&("fade"===s.style?a.css("opacity",0):a.css("visibility","hidden")),s.conditionalOptions&&a.find("select option").each(function(t){parseInt($(this).attr("value"),10)>i?$(this).hide():$(this).show()})})(null),o.on("draw.dt",e))});export default DataTable;