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/pageResize/dataTables.pageResize.min.js

8 lines
1.5 KiB
JavaScript

/*!
PageResize for DataTables v1.0.0
2015 SpryMedia Ltd - datatables.net/license
*/
(function(c){var f=function(a,d){var b=a.table();this.s={dt:a,host:c(b.container()).parent(),header:c(b.header()),footer:c(b.footer()),body:c(b.body()),container:c(b.container()),table:c(b.node()),delta:d};b=this.s.host;"static"===b.css("position")&&b.css("position","relative");this._attach();this._size()};f.prototype={_size:function(){var a=this.s,d=a.dt,b=d.table(),h=c(a.table).offset().top,f=c("tr",a.body).eq(0).height(),e=a.host.height(),i=b.header().parentNode!==b.body().parentNode,g=a.delta;
i||(b.header()&&(e-=a.header.height()),b.footer()&&(e-=a.footer.height()));e=e-h-(a.container.height()-(h+a.table.height()));!isNaN(parseFloat(g))&&isFinite(g)&&(e-=g);a=Math.floor(e/f);Infinity!==a&&(-Infinity!==a&&!isNaN(a)&&0<a&&a!==d.page.len())&&d.page.len(a).draw()},_attach:function(){var a=this,d=c("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");d[0].onload=function(){var b=this.contentDocument.body,c=b.offsetHeight;this.contentDocument.defaultView.onresize=
function(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};d.appendTo(this.s.host).attr("data","about:blank")}};c.fn.dataTable.PageResize=f;c.fn.DataTable.PageResize=f;c(document).on("init.dt",function(a,d){if("dt"===a.namespace){var b=new c.fn.dataTable.Api(d);(c(b.table().node()).hasClass("pageResize")||d.oInit.pageResize||c.fn.dataTable.defaults.pageResize)&&new f(b,d.oInit.pageResizeManualDelta)}})})(jQuery);