breaking changes: 刪除 hide_sidebar_menu_child 配置,改為直接在 menu 配置 close #640

feat: sidebar menu 點擊展開不再限制只能點擊按鈕 #640
feat: TWIKOO 評論圖片添加 lightbox
feat: 升級 facebook comment js 到 v11
fix: 修復可能導致相關文章鏈接出錯的bug #549
improvement: 調整代碼框 ocean theme 下滾動條顏色 close #651
improvement: 當圖片沒有 figcaption 時,不會添加 figcaption 代碼
improvement: 代碼優化
This commit is contained in:
Jerry
2021-09-01 16:10:39 +08:00
Unverified
parent 7210f5b431
commit 484f036adb
16 changed files with 141 additions and 189 deletions

View File

@@ -246,6 +246,33 @@ const btf = {
}
return actualTop
}
},
loadLightbox: ele => {
const service = GLOBAL_CONFIG.lightbox
if (service === 'mediumZoom') {
const zoom = mediumZoom(ele)
zoom.on('open', e => {
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
zoom.update({
background: photoBg
})
})
}
if (service === 'fancybox') {
ele.forEach(i => {
if (i.parentNode.tagName !== 'A') {
const dataSrc = i.dataset.lazySrc || i.src
const dataCaption = i.alt || ''
btf.wrap(i, 'a', { href: dataSrc, 'data-fancybox': 'gallery', 'data-caption': dataCaption, 'data-thumb': dataSrc })
}
})
Fancybox.bind('[data-fancybox]', {
Hash: false
})
}
}
}