This commit is contained in:
Jerry
2020-05-01 18:58:09 +08:00
Unverified
parent e8a47d040a
commit a0655a37c8
23 changed files with 189 additions and 189 deletions

View File

@@ -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()
})
/**