|
|
|
!function(i){var o,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return i(e,window,document)}):"object"==typeof exports?(o=require("jquery"),s=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"!=typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),s(e,t),i(t,0,e.document)}:(s(window,o),module.exports=i(o,window,window.document))):i(jQuery,window,document)}(function(f,e,t,i){"use strict";function o(e,t){var i=e.table();this.s={dt:e,host:f(i.container()).parent(),header:f(i.header()),footer:f(i.footer()),body:f(i.body()),container:f(i.container()),table:f(i.node()),delta:t},this.sizes={offsetTop:this._getOffsetTop(),tableHeight:this._getTableHeight(),containerHeight:this._getContainerHeight(),headerHeight:this._getHeaderHeight(),footerHeight:this._getFooterHeight()};"static"===(i=this.s.host).css("position")&&i.css("position","relative");var o=function(){e.off(".pageResize",o),this.s.obj&&this.s.obj.remove()}.bind(this),s=(e.on("destroy.pageResize",o),this._attach(),"init.pageResize");e.on(s,function(){e.off(s),this._size()}.bind(this))}var s=f.fn.dataTable;return o.prototype={_size:function(){var e=this.s,t=e.dt,i=t.table(),o=f("tr",e.body),o=o.eq(1<o.length?1:0).height(),s=e.host.height(),n=i.header().parentNode!==i.body().parentNode,e=e.delta,a=this.sizes.offsetTop=this._getOffsetTop(),h=this.sizes.tableHeight=this._getTableHeight(),r=this.sizes.containerHeight=this._getContainerHeight(),g=this.sizes.headerHeight=this._getHeaderHeight(),d=this.sizes.footerHeight=this._getFooterHeight(),n=(n||(i.header()&&(s-=g),i.footer()&&(s-=d)),s=s-a-(r-(a+h)),!isNaN(parseFloat(e))&&isFinite(e)&&(s-=e),Math.floor(s/o));n!==1/0&&n!==-1/0&&!isNaN(n)&&0<n&&n!==t.page.len()&&t.page.len(n).draw()},_attach:function(){var o=this,e=f("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");e[0].onload=function(){var e=this.contentDocument,t=e.body,i=t.offsetHeight;e.defaultView.onresize=function(){var e=t.clientHeight||t.offsetHeight;e!==i?(i=e,o._size()):o.sizes.offsetTop===o._getOffsetTop()&&o.sizes.containerHeight===o._getContainerHeight()&&o.sizes.tableHeight===o._getTableHeight()&&o.sizes.headerHeight===o._getHeaderHeight()&&o.sizes.footerHeight===o._getFooterHeight()||o._size()}},e.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=e},_getOffsetTop:function(){return f(this.s.table).offset().top},_getTableHeight:function(){return this.s.table.height()},_getContainerHeight:function(){return this.s.container.height()},_getHeaderHeight:function(){return this.s.dt.table().header()?this.s.header.height():0},_getFooterHeight:function(){return this.s.dt.table().footer()?this.s.footer.height():0}},s.PageResize=o,f(t).on("preInit.dt",function(e,t){"dt"===e.namespace&&(e=new s.Api(t),f(e.table().node()).hasClass("pageResize")||t.oInit.pageResize||s.defaults.pageResize)&&new o(e,t.oInit.pageResizeManualDelta)}),s});
|