11import Vue from 'vue'
22
33import { between } from '../../utils/format.js'
4- import { getMouseWheelDistance , prevent } from '../../utils/event.js'
54import { setScrollPosition , setHorizontalScrollPosition } from '../../utils/scroll.js'
65import { slot , mergeSlot } from '../../utils/slot.js'
76import { cache } from '../../utils/vm.js'
@@ -112,8 +111,8 @@ export default Vue.extend({
112111
113112 dirProps ( ) {
114113 return this . horizontal === true
115- ? { el : 'scrollLeft' , wheel : 'x' }
116- : { el : 'scrollTop' , wheel : 'y' }
114+ ? 'scrollLeft'
115+ : 'scrollTop'
117116 } ,
118117
119118 thumbClass ( ) {
@@ -135,7 +134,7 @@ export default Vue.extend({
135134 getScrollPosition ( ) {
136135 return this . $q . platform . is . desktop === true
137136 ? this . scrollPosition
138- : this . $refs . target [ this . dirProps . el ]
137+ : this . $refs . target [ this . dirProps ]
139138 } ,
140139
141140 setScrollPosition ( offset , duration ) {
@@ -196,39 +195,6 @@ export default Vue.extend({
196195 this . __setScroll ( pos )
197196 } ,
198197
199- __panContainer ( e ) {
200- if ( e . isFirst === true ) {
201- this . refPos = this . scrollPosition
202- this . __setActive ( true , true )
203- }
204- if ( e . isFinal === true ) {
205- this . __setActive ( false )
206- }
207-
208- const distance = e . distance [ this . horizontal === true ? 'x' : 'y' ]
209- const pos = this . refPos +
210- ( e . direction === this . direction ? - 1 : 1 ) * distance
211-
212- this . __setScroll ( pos )
213-
214- if ( pos > 0 && pos + this . containerSize < this . scrollSize ) {
215- prevent ( e . evt )
216- }
217- } ,
218-
219- __mouseWheel ( e ) {
220- const el = this . $refs . target
221-
222- el [ this . dirProps . el ] += getMouseWheelDistance ( e ) [ this . dirProps . wheel ]
223-
224- if (
225- el [ this . dirProps . el ] > 0 &&
226- el [ this . dirProps . el ] + this . containerSize < this . scrollSize
227- ) {
228- prevent ( e )
229- }
230- } ,
231-
232198 __setActive ( active , timer ) {
233199 clearTimeout ( this . timer )
234200
@@ -258,7 +224,7 @@ export default Vue.extend({
258224 } ,
259225
260226 __setScroll ( offset ) {
261- this . $refs . target [ this . dirProps . el ] = offset
227+ this . $refs . target [ this . dirProps ] = offset
262228 }
263229 } ,
264230
@@ -286,19 +252,7 @@ export default Vue.extend({
286252 } , [
287253 h ( 'div' , {
288254 ref : 'target' ,
289- staticClass : 'scroll relative-position fit hide-scrollbar' ,
290- on : cache ( this , 'wheel' , {
291- wheel : this . __mouseWheel
292- } ) ,
293- directives : cache ( this , 'touch#' + this . horizontal , [ {
294- name : 'touch-pan' ,
295- modifiers : {
296- vertical : this . horizontal !== true ,
297- horizontal : this . horizontal ,
298- mightPrevent : true
299- } ,
300- value : this . __panContainer
301- } ] )
255+ staticClass : 'scroll relative-position fit hide-scrollbar'
302256 } , [
303257 h ( 'div' , {
304258 staticClass : 'absolute' ,
0 commit comments