mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Fix page:loaded event
This commit is contained in:
parent
69e0dbdeea
commit
0a170b8cd6
@ -13,11 +13,7 @@ HTMLElement.prototype.wrap = function(wrapper) {
|
||||
})
|
||||
);
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('readystatechange', onPageLoaded, { once: true });
|
||||
} else {
|
||||
onPageLoaded();
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', onPageLoaded);
|
||||
document.addEventListener('pjax:success', onPageLoaded);
|
||||
})();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user