mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
breaking changes: toc 配置更改,頁面支持 toc 顯示 close #636
feat: 代碼框設置高度限制,展開後按鈕不會消失,可點擊再次摺疊 close #637 feat: 增加 no-lightbox class 偵測,可配置 fancybox 和 medium-zoom 不應用於圖片 #636 fix: 修復開啟 lazyload 時, fancybox 的縮略圖顯示 lazyload 加載圖片的 bug
This commit is contained in:
@@ -209,7 +209,11 @@ blockquote
|
||||
animation: code-expand-key 1.2s infinite
|
||||
|
||||
&.expand-done
|
||||
display: none !important
|
||||
& > i
|
||||
transform: rotate(180deg)
|
||||
|
||||
& + table
|
||||
margin-bottom: 1.8em
|
||||
|
||||
&:not(.expand-done)
|
||||
& ~ table,
|
||||
|
||||
@@ -239,7 +239,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
*/
|
||||
const addFancybox = () => {
|
||||
const runFancybox = () => {
|
||||
document.querySelectorAll('#article-container :not(a):not(.not-lightbox) > img, #article-container > img').forEach(i => {
|
||||
document.querySelectorAll('#article-container img:not(.no-lightbox)').forEach(i => {
|
||||
const lazyloadSrc = i.dataset.lazySrc || i.src
|
||||
const dataCaption = i.alt || ''
|
||||
btf.wrap(i, 'a', { href: lazyloadSrc, 'data-fancybox': 'gallery', 'data-caption': dataCaption, 'data-thumb': lazyloadSrc })
|
||||
@@ -266,7 +266,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
|
||||
const addMediumZoom = () => {
|
||||
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a):not(.not-lightbox) > img, #article-container > img'))
|
||||
const zoom = mediumZoom(document.querySelectorAll('#article-container img:not(.no-lightbox)'))
|
||||
zoom.on('open', e => {
|
||||
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
||||
zoom.update({
|
||||
@@ -841,7 +841,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
initAdjust()
|
||||
|
||||
if (GLOBAL_CONFIG_SITE.isPost) {
|
||||
GLOBAL_CONFIG_SITE.isToc && tocFn()
|
||||
GLOBAL_CONFIG.noticeOutdate !== undefined && addPostOutdateNotice()
|
||||
GLOBAL_CONFIG.relativeDate.post && relativeDate(document.querySelectorAll('#post-meta time'))
|
||||
} else {
|
||||
@@ -851,6 +850,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
toggleCardCategory()
|
||||
}
|
||||
|
||||
GLOBAL_CONFIG_SITE.isToc && tocFn()
|
||||
sidebarFn()
|
||||
GLOBAL_CONFIG_SITE.isHome && scrollDownInIndex()
|
||||
addHighlightTool()
|
||||
|
||||
Reference in New Issue
Block a user