Skip to content

Commit 50279fb

Browse files
committed
🐞 fix bug re-init on destroyed element. #807
remove jQuery data on destroy
1 parent 6ac2052 commit 50279fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/core.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ proto.destroy = function() {
332332

333333
delete this.element.infiniteScrollGUID;
334334
delete instances[ this.guid ];
335+
// remove jQuery data. #807
336+
if ( jQuery && this.$element ) {
337+
jQuery.removeData( this.element, 'infiniteScroll' );
338+
}
335339
};
336340

337341
// -------------------------- utilities -------------------------- //

0 commit comments

Comments
 (0)