Skip to content

Commit

Permalink
fix(web): check readwidth min value
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwite committed Oct 19, 2024
1 parent c9a7e3a commit 6709aea
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions modules/web/src/views/BookChapter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ const onResize = () => {
const width = store.config.readWidth /**包含padding */
checkPageWidth(width)
}
/** 判断阅读宽度是否超出页面 */
/** 判断阅读宽度是否超出页面或者低于默认值640 */
const checkPageWidth = (readWidth: number) => {
if (store.miniInterface) return
if (readWidth < 640) store.config.readWidth = 640
if (readWidth + 2 * 68 > window.innerWidth) store.config.readWidth -= 160
}
watch(
Expand Down Expand Up @@ -462,11 +463,7 @@ const handleKeyPress = (event: KeyboardEvent) => {
}
// 阻止默认滚动事件
const ignoreKeyPress = (event: {
key: string
preventDefault: () => void
stopPropagation: () => void
}) => {
const ignoreKeyPress = (event: KeyboardEvent) => {
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
event.preventDefault()
event.stopPropagation()
Expand Down

0 comments on commit 6709aea

Please sign in to comment.