From b308a5b5baef411ccf3ca8b642e9ce22d0001233 Mon Sep 17 00:00:00 2001 From: Joost Molenkamp Date: Thu, 1 Sep 2022 20:40:39 +0200 Subject: [PATCH] ScrollResize: remove resize helper iframe on table destruction --- features/scrollResize/dataTables.scrollResize.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/features/scrollResize/dataTables.scrollResize.js b/features/scrollResize/dataTables.scrollResize.js index 2017dea4..4a01d204 100644 --- a/features/scrollResize/dataTables.scrollResize.js +++ b/features/scrollResize/dataTables.scrollResize.js @@ -83,6 +83,12 @@ var ScrollResize = function ( dt ) that._size(); } ); + var onDestroy = function () { + dt.off('.pageResize', onDestroy); + this.s.obj && this.s.obj.remove(); + }.bind(this); + dt.on('destroy.pageResize', onDestroy); + this._attach(); this._size(); }; @@ -154,7 +160,9 @@ ScrollResize.prototype = { obj .appendTo( this.s.host ) .attr( 'data', 'about:blank' ); - } + + this.s.obj = obj; + } };