diff --git a/src/jquery.floatThead.js b/src/jquery.floatThead.js index aa3cc08..a6a0270 100644 --- a/src/jquery.floatThead.js +++ b/src/jquery.floatThead.js @@ -104,7 +104,7 @@ return that; })(); - var canObserveMutations = typeof MutationObserver !== 'undefined'; + var globalCanObserveMutations = typeof MutationObserver !== 'undefined'; //browser stuff @@ -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(); } @@ -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){