mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-08-09 03:58:51 +08:00
improvement
This commit is contained in:
+13
-7
@@ -6,10 +6,14 @@ script.
|
||||
(window.Chatra.q = window.Chatra.q || []).push(arguments)
|
||||
}
|
||||
|
||||
btf.getScript('https://call.chatra.io/chatra.js').then(() => {
|
||||
const isChatBtn = !{theme.chat.rightside_button}
|
||||
const isChatHideShow = !{theme.chat.button_hide_show}
|
||||
const isChatBtn = !{theme.chat.rightside_button}
|
||||
const isChatHideShow = !{theme.chat.button_hide_show}
|
||||
|
||||
if (isChatBtn) {
|
||||
window.ChatraSetup = { startHidden: true }
|
||||
}
|
||||
|
||||
btf.getScript('https://call.chatra.io/chatra.js').then(() => {
|
||||
if (isChatBtn) {
|
||||
const close = () => {
|
||||
Chatra('minimizeWidget')
|
||||
@@ -21,11 +25,13 @@ script.
|
||||
Chatra('show')
|
||||
}
|
||||
|
||||
window.ChatraSetup = { startHidden: true }
|
||||
|
||||
window.chatBtnFn = () => document.getElementById('chatra').classList.contains('chatra--expanded') ? close() : open()
|
||||
window.chatBtnFn = () => {
|
||||
const el = document.getElementById('chatra')
|
||||
return el && el.classList.contains('chatra--expanded') ? close() : open()
|
||||
}
|
||||
|
||||
document.getElementById('chat-btn').style.display = 'block'
|
||||
const chatBtn = document.getElementById('chat-btn')
|
||||
if (chatBtn) chatBtn.style.display = 'block'
|
||||
} else if (isChatHideShow) {
|
||||
window.chatBtn = {
|
||||
hide: () => Chatra('hide'),
|
||||
|
||||
Reference in New Issue
Block a user