mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
breaking changes: 升級 fontawesome 到 v6 #689
feat: snackbar 增加圓角 feat: 增加 flink 標籤外掛 fix: 修復點擊 toc 外圍,控制檯報錯的 bug fix: Facebook Comments 無法使用 #787 fix: chat_btn 聊天按鈕翻譯缺失 #791 fix: local search 的 content 設爲 false, 搜索無法運行的 bug #764 fix: Mermaid 圖表渲染後元素高度過大 #773 fix: 文章頁分享按鈕另開一行時, 導航頁寬度沒有 100% 的 bug #765 improvement: 語義化 toggle 標籤外掛 improvement: darkmode 下 toc 背景顏色更改
This commit is contained in:
@@ -361,7 +361,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
// toc元素點擊
|
||||
$cardToc.addEventListener('click', e => {
|
||||
e.preventDefault()
|
||||
const $target = e.target.classList.contains('toc-link')
|
||||
const target = e.target.classList
|
||||
if (target.contains('toc-content')) return
|
||||
const $target = target.contains('toc-link')
|
||||
? e.target
|
||||
: e.target.parentElement
|
||||
btf.scrollToDest(btf.getEleTop(document.getElementById(decodeURI($target.getAttribute('href')).replace('#', ''))), 300)
|
||||
@@ -613,13 +615,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
$hideInline.forEach(function (item) {
|
||||
item.addEventListener('click', function (e) {
|
||||
const $this = this
|
||||
const $hideContent = $this.nextElementSibling
|
||||
$this.classList.toggle('open')
|
||||
if ($this.classList.contains('open')) {
|
||||
if ($hideContent.querySelectorAll('.fj-gallery').length > 0) {
|
||||
btf.initJustifiedGallery($hideContent.querySelectorAll('.fj-gallery'))
|
||||
}
|
||||
}
|
||||
$this.classList.add('open')
|
||||
const $fjGallery = $this.nextElementSibling.querySelectorAll('.fj-gallery')
|
||||
$fjGallery.length && btf.initJustifiedGallery($fjGallery)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user