Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
move MutationObserver definition to correct Firefox problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Sep 12, 2013
1 parent 1ef334f commit 1ac4907
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,16 @@ function handler(mutations) {
logFlags.dom && console.groupEnd();
};

var observer = new MutationObserver(handler);

function takeRecords() {
// TODO(sjmiles): ask Raf why we have to call handler ourselves
handler(observer.takeRecords());
}

var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);

var observer = new MutationObserver(handler);

function observe(inRoot) {
// TODO(sorvell): delay creation of mutation observer to help with
// IE flakiness
if (!observer) {
observer = new MutationObserver(handler);
}
observer.observe(inRoot, {childList: true, subtree: true});
}

Expand Down

0 comments on commit 1ac4907

Please sign in to comment.