diff options
author | Dillon <dillonzq@outlook.com> | 2020-04-26 21:27:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 21:27:26 +0300 |
commit | b46c81053f7a4307945b82bee6944af7e6e13d1c (patch) | |
tree | bd571b2331ed6d4215a1fbd0f924eea617e064b0 /src | |
parent | fc46fba6aa1a747d19c9d0b37b0a26e944cfbba3 (diff) |
feat(twemoji): add support for twemoji (#264)
Diffstat (limited to 'src')
-rw-r--r-- | src/js/theme.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/js/theme.js b/src/js/theme.js index 0f91b24..bf00f1b 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -42,7 +42,7 @@ class Theme { this.clickMaskEventSet = new Set(); } - initIcon() { + initSVGIcon() { this.util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => { fetch($icon.getAttribute('data-svg-src')) .then(response => response.text()) @@ -58,6 +58,10 @@ class Theme { }); } + initTwemoji() { + if (this.config.twemoji) twemoji.parse(document.body); + } + initMenuMobile() { const $menuToggleMobile = document.getElementById('menu-toggle-mobile'); const $menuMobile = document.getElementById('menu-mobile'); @@ -638,7 +642,8 @@ class Theme { } init() { - this.initIcon(); + this.initSVGIcon(); + this.initTwemoji(); this.initMenuMobile(); this.initSwitchTheme(); this.initSearch(); |