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

2 lines
1.6 KiB
JavaScript

/*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";var ScrollResize=function(t){var e=this,o=t.table(),o=(this.s={dt:t,host:$(o.container()).parent(),header:$(o.header()),footer:$(o.footer()),body:$(o.body()),container:$(o.container()),table:$(o.node())},this.s.host),o=("static"===o.css("position")&&o.css("position","relative"),t.on("draw.scrollResize",function(){e._size()}),t.on("destroy.scrollResize",function(){t.off(".scrollResize"),this.s.obj&&this.s.obj.remove()}.bind(this)),this._attach(),this._size(),t.settings()[0]),i=o.nScrollBody,i=i.scrollHeight>i.clientHeight;o.scrollBarVis&&!i&&t.columns.adjust()};ScrollResize.prototype={_size:function(){var t=this.s,e=t.dt.table(),o=$(t.table).offset().top,i=t.host.height(),s=$("div.dataTables_scrollBody",e.container()),i=(i-=o)-(t.container.height()-(o+s.height()));$("div.dataTables_scrollBody",e.container()).css({maxHeight:i,height:i})},_attach:function(){var a=this,t=$("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");t[0].onload=function(){var t=this.contentDocument,o=t.body,i=o.offsetHeight,s=t;(s.defaultView||s.parentWindow).onresize=function(){var t=o.clientHeight||o.offsetHeight,e=s.documentElement.clientHeight;(t=!t&&e?e:t)!==i&&(i=t,a._size())}},t.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=t}},DataTable.ScrollResize=ScrollResize,$(document).on("init.dt",function(t,e){"dt"===t.namespace&&(t=new DataTable.Api(e),e.oInit.scrollResize||DataTable.defaults.scrollResize)&&new ScrollResize(t)});export default DataTable;