From 4e3e54bb2ad50f7aed6b8e398a7ee8381fe39d82 Mon Sep 17 00:00:00 2001 From: Dillon Date: Fri, 29 May 2020 11:31:26 +0800 Subject: chore: update theme.js init --- src/js/theme.js | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/js/theme.js b/src/js/theme.js index 91b4b9f..ac2c4e5 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -697,29 +697,36 @@ class Theme { } init() { - this.initSVGIcon(); - this.initTwemoji(); - this.initMenuMobile(); - this.initSwitchTheme(); - this.initSearch(); - this.initDetails(); - this.initLightGallery(); - this.initHighlight(); - this.initTable(); - this.initHeaderLink(); - this.initToc(); - this.initComment(); - this.initSmoothScroll(); - this.initMath(); - this.initMermaid(); - this.initEcharts(); - this.initTypeit(); - this.initMapbox(); - this.initCookieconsent(); - - this.onScroll(); - this.onResize(); - this.onClickMask(); + try { + this.initSVGIcon(); + this.initTwemoji(); + this.initMenuMobile(); + this.initSwitchTheme(); + this.initSearch(); + this.initDetails(); + this.initLightGallery(); + this.initHighlight(); + this.initTable(); + this.initHeaderLink(); + this.initSmoothScroll(); + this.initMath(); + this.initMermaid(); + this.initEcharts(); + this.initTypeit(); + this.initMapbox(); + this.initCookieconsent(); + } catch (err) { + console.error(err); + } + + window.setTimeout(() => { + this.initToc(); + this.initComment(); + + this.onScroll(); + this.onResize(); + this.onClickMask(); + }, 100); } } -- cgit v1.2.3