Skip to content

Commit

Permalink
remove deprecated api
Browse files Browse the repository at this point in the history
  • Loading branch information
iwate committed Dec 8, 2023
1 parent 07d444a commit 13892ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,15 @@ if (window.$) {
$('link[rel=stylesheet][media=print]').each(function(i, el) { el.media = 'all'; });

$(window).on('DOMContentLoaded', function(e){setup(document.body)});
$(document.body).on('DOMNodeInserted', function(e){setup(e.target)});
// https://w3c.github.io/uievents/#legacy-event-types
//$(document.body).on('DOMNodeInserted', function(e){setup(e.target)});
new MutationObserver(function(mutations) {
for (const mutation of mutations) {
for (const node of mutation.addedNodes) {
setup(node);
}
}
}).observe(document.body, {attributes:false,childList:true,subtree:true});
}

function setup(root) {
Expand Down

0 comments on commit 13892ce

Please sign in to comment.