fix: Fix issue with scrollresize calling legacy api method on FixedColumns

Jira Issue DD-2417
pull/534/head
SandyDatatables 3 years ago
parent a7cb879051
commit 309709aded

@ -107,10 +107,6 @@ ScrollResize.prototype = {
maxHeight: availableHeight, maxHeight: availableHeight,
height: availableHeight height: availableHeight
} ); } );
if ( dt.fixedColumns ) {
dt.fixedColumns().relayout();
}
}, },
_attach: function () { _attach: function () {

@ -21,7 +21,7 @@
ScrollResize for DataTables v1.0.0 ScrollResize for DataTables v1.0.0
2015 SpryMedia Ltd - datatables.net/license 2015 SpryMedia Ltd - datatables.net/license
*/ */
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return a(e,window,document)}):"object"===typeof exports?module.exports=function(e,g){e||(e=window);g&&g.fn.dataTable||(g=require("datatables.net")(e,g).$);return a(g,e,e.document)}:a(jQuery,window,document)})(function(a,e,g,n){var l=function(c){var d=this,b=c.table();this.s={dt:c,host:a(b.container()).parent(),header:a(b.header()),footer:a(b.footer()),body:a(b.body()),container:a(b.container()),table:a(b.node())}; (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return a(e,window,document)}):"object"===typeof exports?module.exports=function(e,f){e||(e=window);f&&f.fn.dataTable||(f=require("datatables.net")(e,f).$);return a(f,e,e.document)}:a(jQuery,window,document)})(function(a,e,f,n){var k=function(c){var d=this,b=c.table();this.s={dt:c,host:a(b.container()).parent(),header:a(b.header()),footer:a(b.footer()),body:a(b.body()),container:a(b.container()),table:a(b.node())};
b=this.s.host;"static"===b.css("position")&&b.css("position","relative");c.on("draw",function(){d._size()});this._attach();this._size()};l.prototype={_size:function(){var c=this.s,d=c.dt,b=d.table(),k=a(c.table).offset().top,f=c.host.height(),h=a("div.dataTables_scrollBody",b.container());f=f-k-(c.container.height()-(k+h.height()));a("div.dataTables_scrollBody",b.container()).css({maxHeight:f,height:f});d.fixedColumns&&d.fixedColumns().relayout()},_attach:function(){var c=this,d=a("<iframe/>").css({position:"absolute", b=this.s.host;"static"===b.css("position")&&b.css("position","relative");c.on("draw",function(){d._size()});this._attach();this._size()};k.prototype={_size:function(){var c=this.s,d=c.dt.table(),b=a(c.table).offset().top,g=c.host.height(),h=a("div.dataTables_scrollBody",d.container());g=g-b-(c.container.height()-(b+h.height()));a("div.dataTables_scrollBody",d.container()).css({maxHeight:g,height:g})},_attach:function(){var c=this,d=a("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",
top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");d[0].onload=function(){var b=this.contentDocument.body,k=b.offsetHeight,f=this.contentDocument;(f.defaultView||f.parentWindow).onresize=function(){var h=b.clientHeight||b.offsetHeight,m=f.documentElement.clientHeight;!h&&m&&(h=m);h!==k&&(k=h,c._size())}};d.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=l;a.fn.DataTable.ScrollResize=l;a(g).on("init.dt",function(c, width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");d[0].onload=function(){var b=this.contentDocument.body,g=b.offsetHeight,h=this.contentDocument;(h.defaultView||h.parentWindow).onresize=function(){var l=b.clientHeight||b.offsetHeight,m=h.documentElement.clientHeight;!l&&m&&(l=m);l!==g&&(g=l,c._size())}};d.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=k;a.fn.DataTable.ScrollResize=k;a(f).on("init.dt",function(c,d){"dt"===c.namespace&&
d){"dt"===c.namespace&&(c=new a.fn.dataTable.Api(d),(d.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new l(c))})}); (c=new a.fn.dataTable.Api(d),(d.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new k(c))})});

Loading…
Cancel
Save