Commit dac6cc4 1 parent f265627 commit dac6cc4 Copy full SHA for dac6cc4
File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11
11
import ToolButton from ' components/pic_tools/ToolButton'
12
12
import {mapState } from ' vuex'
13
13
14
- const scrollDistance = window .innerHeight
15
- // const scrollDistance = window.innerHeight * 3 / 4
16
14
const keymap = {
17
15
scrollUp: [' w' ,' ArrowUp' ],
18
16
scrollDown: [' s' , ' ArrowDown' ],
@@ -136,13 +134,20 @@ export default {
136
134
this .$log .debug (' setting' )
137
135
this .$bus .emit (' btn_click_setting' )
138
136
},
137
+ scroll : function () {
138
+ return document .querySelector (" #waterfall_page" )
139
+ },
140
+ scrollDistance : function () {
141
+ return this .scroll ().clientHeight
142
+ // return this.scroll().clientHeight * 3 / 4
143
+ },
139
144
scrollUp (event ) {
140
145
event .preventDefault ()
141
- window . scrollBy ({ top: - scrollDistance, behavior: ' smooth' })
146
+ this . scroll (). scrollBy ({ top: - this . scrollDistance () , behavior: ' smooth' })
142
147
},
143
148
scrollDown (event ) {
144
149
event .preventDefault ()
145
- window . scrollBy ({ top: scrollDistance, behavior: ' smooth' })
150
+ this . scroll (). scrollBy ({ top: this . scrollDistance () , behavior: ' smooth' })
146
151
},
147
152
shortcut : function (event ) {
148
153
if (! this .image_shortcut ) {
Original file line number Diff line number Diff line change 1
1
<template >
2
- <q-page class =" full-height-width" >
2
+ <q-page id = " waterfall_page " class =" full-height-width" style = " height : 95 vh ; overflow-y : auto ; " >
3
3
4
4
<vue-waterfall ref =" waterfall"
5
5
:gutter =" 8" :lazyload =" true" :delay =" 400"
@@ -294,7 +294,7 @@ export default {
294
294
btn_click_goto_top () {
295
295
this .$log .debug (' waterfall' , this .$refs .waterfall .$el )
296
296
// debugger
297
- document .querySelector (' html ' ).scrollTop = 0
297
+ document .querySelector (" #waterfall_page " ).scrollTop = 0
298
298
},
299
299
btn_click_loadMore () {
300
300
this .$store .dispatch (` ${ this .storeName } /auto_next` , true )
You can’t perform that action at this time.
0 commit comments