mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
🏷️ 更新2.3.5 更新內容查看 https://github.com/jerryc127/hexo-theme-butterfly/releases/tag/2.3.5
This commit is contained in:
@@ -445,6 +445,13 @@ $(function () {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* lazyload
|
||||
*/
|
||||
if (GLOBAL_CONFIG.islazyload) {
|
||||
window.lozad('img').observe()
|
||||
}
|
||||
|
||||
/**
|
||||
* 滾動處理
|
||||
*/
|
||||
@@ -532,11 +539,13 @@ $(function () {
|
||||
}, 100)
|
||||
}
|
||||
|
||||
// function updateAnchor (anchor) {
|
||||
// if (window.history.replaceState && anchor !== window.location.hash) {
|
||||
// window.history.replaceState(null, null, anchor)
|
||||
// }
|
||||
// }
|
||||
// anchor
|
||||
var isanchor = GLOBAL_CONFIG.isanchor
|
||||
var updateAnchor = function (anchor) {
|
||||
if (window.history.replaceState && anchor !== window.location.hash) {
|
||||
window.history.replaceState(undefined, undefined, anchor)
|
||||
}
|
||||
}
|
||||
|
||||
// find head position & add active class
|
||||
// DOM Hierarchy:
|
||||
@@ -565,7 +574,7 @@ $(function () {
|
||||
|
||||
var currentActive = $('.toc-link.active')
|
||||
if (currentId && currentActive.attr('href') !== currentId) {
|
||||
// updateAnchor(currentId)
|
||||
if (isanchor) updateAnchor(currentId)
|
||||
|
||||
$('.toc-link').removeClass('active')
|
||||
|
||||
@@ -711,11 +720,7 @@ $(function () {
|
||||
|
||||
$darkModeButtom.click(function () {
|
||||
switchReadMode()
|
||||
try {
|
||||
utterancesTheme()
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
if (typeof utterancesTheme === 'function') utterancesTheme()
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user