feat(twemoji): add support for twemoji (#264)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user