Fix: bind DOMContentLoaded event on document instead of window

This commit is contained in:
Mimi 2020-04-25 00:57:44 +08:00
parent eee457cab6
commit cd5e54193b
6 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/* global instantsearch, algoliasearch, CONFIG */
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
const algoliaSettings = CONFIG.algolia;
const { indexName, appID, apiKey } = algoliaSettings;

View File

@ -1,6 +1,6 @@
/* global CONFIG */
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
'use strict';
var doSaveScroll = () => {

View File

@ -1,6 +1,6 @@
/* global CONFIG */
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
// Popup Window
let isfetched = false;
let datas;

View File

@ -107,7 +107,7 @@ NexT.boot.motion = function() {
NexT.utils.updateSidebarPosition();
};
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
NexT.boot.registerEvents();
NexT.boot.refresh();
NexT.boot.motion();

View File

@ -1,6 +1,6 @@
/* global NexT, CONFIG, Velocity */
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
var isRight = CONFIG.sidebar.position === 'right';
var SIDEBAR_WIDTH = CONFIG.sidebar.width || 320;

View File

@ -80,7 +80,7 @@ NexT.utils.getAffixParam = function() {
};
};
window.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
Affix.init(document.querySelector('.sidebar-inner'), NexT.utils.getAffixParam());
});