mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Fix: bind DOMContentLoaded event on document instead of window
This commit is contained in:
parent
eee457cab6
commit
cd5e54193b
@ -1,6 +1,6 @@
|
|||||||
/* global instantsearch, algoliasearch, CONFIG */
|
/* global instantsearch, algoliasearch, CONFIG */
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const algoliaSettings = CONFIG.algolia;
|
const algoliaSettings = CONFIG.algolia;
|
||||||
const { indexName, appID, apiKey } = algoliaSettings;
|
const { indexName, appID, apiKey } = algoliaSettings;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* global CONFIG */
|
/* global CONFIG */
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var doSaveScroll = () => {
|
var doSaveScroll = () => {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* global CONFIG */
|
/* global CONFIG */
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
// Popup Window
|
// Popup Window
|
||||||
let isfetched = false;
|
let isfetched = false;
|
||||||
let datas;
|
let datas;
|
||||||
|
|||||||
@ -107,7 +107,7 @@ NexT.boot.motion = function() {
|
|||||||
NexT.utils.updateSidebarPosition();
|
NexT.utils.updateSidebarPosition();
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
NexT.boot.registerEvents();
|
NexT.boot.registerEvents();
|
||||||
NexT.boot.refresh();
|
NexT.boot.refresh();
|
||||||
NexT.boot.motion();
|
NexT.boot.motion();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* global NexT, CONFIG, Velocity */
|
/* global NexT, CONFIG, Velocity */
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
var isRight = CONFIG.sidebar.position === 'right';
|
var isRight = CONFIG.sidebar.position === 'right';
|
||||||
var SIDEBAR_WIDTH = CONFIG.sidebar.width || 320;
|
var SIDEBAR_WIDTH = CONFIG.sidebar.width || 320;
|
||||||
|
|||||||
@ -80,7 +80,7 @@ NexT.utils.getAffixParam = function() {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
Affix.init(document.querySelector('.sidebar-inner'), NexT.utils.getAffixParam());
|
Affix.init(document.querySelector('.sidebar-inner'), NexT.utils.getAffixParam());
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user