Skip to content

Commit

Permalink
ScrollResize: remove draw event handler on table destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
JMolenkamp committed Sep 6, 2022
1 parent a25c282 commit ca1e539
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions features/scrollResize/dataTables.scrollResize.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,14 @@ var ScrollResize = function ( dt )
host.css( 'position', 'relative' );
}

dt.on( 'draw', function () {
dt.on( 'draw.scrollResize', function () {
that._size();
} );

var onDestroy = function () {
dt.off('.pageResize', onDestroy);
dt.on('destroy.scrollResize', function () {
dt.off('.scrollResize');
this.s.obj && this.s.obj.remove();
}.bind(this);
dt.on('destroy.pageResize', onDestroy);
}.bind(this));

this._attach();
this._size();
Expand Down

0 comments on commit ca1e539

Please sign in to comment.