Skip to content

Commit

Permalink
Fix destroy function when using autoReflow with multiple tables (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Bogochow authored Mar 12, 2020
1 parent 234a4e0 commit ec2519f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
return that;
})();

var canObserveMutations = typeof MutationObserver !== 'undefined';
var globalCanObserveMutations = typeof MutationObserver !== 'undefined';


//browser stuff
Expand Down Expand Up @@ -260,8 +260,6 @@
return this; //no more crappy browser support.
}

var mObs = null; //mutation observer lives in here if we can use it / make it

if(util.isFunction(isTableWidthBug)) {
isTableWidthBug = isTableWidthBug();
}
Expand Down Expand Up @@ -309,7 +307,8 @@
if(!$table.is('table')){
throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');
}
canObserveMutations = opts.autoReflow && canObserveMutations; //option defaults to false!
var canObserveMutations = opts.autoReflow && globalCanObserveMutations; //option defaults to false!
var mObs = null; //mutation observer lives in here if we can use it / make it
var $header = $table.children('thead:first');
var $tbody = $table.children('tbody:first');
if($header.length === 0 || $tbody.length === 0){
Expand Down

0 comments on commit ec2519f

Please sign in to comment.