Skip to content

Commit

Permalink
fix: scan observer target classList with observer type of childList
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Apr 24, 2021
1 parent 7b6d7d9 commit c1e4d7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ window.addEventListener("load", function() {


// // console.log('ccCSS observer start', performance.now())

hasChange = addParsingClassList(mutation.target.classList);
if (mutation.type == "childList")
mutation.target.querySelectorAll("*").forEach((el) => {
hasChange = addParsingClassList(el.classList) || hasChange;
});
else
hasChange = addParsingClassList(mutation.target.classList);


// styleList.forEach(i => styleElSheet.insertRule(i))
addNewRules()

Expand Down

0 comments on commit c1e4d7a

Please sign in to comment.