Skip to content

Commit

Permalink
chore: 0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zkz098 committed Jun 26, 2024
1 parent 3a1a435 commit 0801c5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions source/js/_app/components/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const sidebarTOC = () => {
}
// Scrolling to center active TOC element if TOC content is taller than viewport.
if (getComputedStyle(sideBar).display !== 'none' && tocElement.hasClass('active')) {
pageScroll(tocElement, target.offsetTop - (tocElement.offsetHeight / 4))
pageScroll((tocElement as HTMLElement), target.offsetTop - ((tocElement as HTMLElement).offsetHeight / 4))
}
}
const navItems = $dom.all('.contents li')
Expand All @@ -142,7 +142,7 @@ export const sidebarTOC = () => {
return
}

let sections = [...navItems]
let sections = [...navItems] as HTMLElement[]
let activeLock = null

sections = sections.map((element, index) => {
Expand All @@ -156,7 +156,7 @@ export const sidebarTOC = () => {
const target = document.querySelector(decodeURI((event.currentTarget as HTMLElement).getAttribute('href')))

activeLock = index
pageScroll(target, null, () => {
pageScroll((target as HTMLElement), null, () => {
activateNavByIndex(index)
activeLock = null
})
Expand All @@ -165,10 +165,10 @@ export const sidebarTOC = () => {
// TOC item animation navigate.
link.addEventListener('click', anchorScroll)
alink && alink.addEventListener('click', (event) => {
anchorScroll(event)
anchorScroll(<MouseEvent>event)
clipBoard(CONFIG.hostname + '/' + LOCAL.path + (event.currentTarget as HTMLElement).getAttribute('href'))
})
return anchor
return (anchor as HTMLElement)
})

const tocElement = sideBar.querySelector('.contents.panel')
Expand Down
2 changes: 1 addition & 1 deletion source/js/_app/page/fancybox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { $dom } from '../library/dom'
import { vendorCss, vendorJs } from '../library/loadFile'
import { insertAfter } from '../library/proto'

// TODO 使用LightGallery/PhotoSwipe替换Fancybox
// TODO 使用PhotoSwipe替换Fancybox
export const postFancybox = (p:string) => {
if (document.querySelector(p + ' .md img')) {
vendorCss('fancybox')
Expand Down
1 change: 0 additions & 1 deletion source/js/_app/player.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { CONFIG, originTitle } from './globals/globalVars'
import { showtip } from './globals/tools'
import { pageScroll } from './library/anime'
import { $dom } from './library/dom'
import { $storage } from './library/storage'
import { tabFormat } from './page/tab'
import { createChild, getLeft, getWidth, setDisplay, setWidth } from './library/proto'
Expand Down

0 comments on commit 0801c5a

Please sign in to comment.