@@ -27,7 +27,7 @@ export default class SnappedDrawer {
27
27
this . _target = options . TARGET
28
28
this . _handlers = null
29
29
this . _direction = options . DIRECTION
30
- this . _callibration = null
30
+ this . _calibration = null
31
31
this . _callbacks = null
32
32
this . _context = this
33
33
this . _id = 0
@@ -58,25 +58,25 @@ export default class SnappedDrawer {
58
58
59
59
const startHandler = ( touchEvent ) => {
60
60
const activity = this . _drawerManager . getRunningActivity ( )
61
- if ( this . _callibration &&
61
+ if ( this . _calibration &&
62
62
( this . _id && activity && activity . id === this . _id ||
63
63
! activity && this . _isCoolSignal ( this . _getSignal ( touchEvent ) ) ) ) {
64
- this . _callibration . start ( touchEvent , startfn )
64
+ this . _calibration . start ( touchEvent , startfn )
65
65
}
66
66
}
67
67
68
68
const moveHandler = ( touchEvent ) => {
69
69
const activity = this . _drawerManager . getRunningActivity ( )
70
- if ( this . _callibration && activity && activity . id === this . _id ) {
71
- this . _callibration . move ( touchEvent , movefn )
70
+ if ( this . _calibration && activity && activity . id === this . _id ) {
71
+ this . _calibration . move ( touchEvent , movefn )
72
72
}
73
73
}
74
74
75
75
const endHandler = ( touchEvent ) => {
76
76
const activity = this . _drawerManager . getRunningActivity ( )
77
- if ( this . _callibration && activity && activity . id === this . _id ) {
77
+ if ( this . _calibration && activity && activity . id === this . _id ) {
78
78
const state = { }
79
- this . _callibration . end ( touchEvent , endfn , state ) // state by Ref
79
+ this . _calibration . end ( touchEvent , endfn , state ) // state by Ref
80
80
this . _processThresholdState ( state )
81
81
}
82
82
}
@@ -149,7 +149,7 @@ export default class SnappedDrawer {
149
149
150
150
setContext ( ctx ) {
151
151
this . _context = ctx
152
- this . _callibration . setContext ( ctx )
152
+ this . _calibration . setContext ( ctx )
153
153
return this
154
154
}
155
155
@@ -182,24 +182,24 @@ export default class SnappedDrawer {
182
182
_setCalibration ( point , bound ) {
183
183
switch ( point ) {
184
184
case SnappedDrawer . UP :
185
- this . _callibration = new Top ( this . _options , bound )
185
+ this . _calibration = new Top ( this . _options , bound )
186
186
break
187
187
case SnappedDrawer . LEFT :
188
- this . _callibration = new Left ( this . _options , bound )
188
+ this . _calibration = new Left ( this . _options , bound )
189
189
break
190
190
case SnappedDrawer . DOWN :
191
- this . _callibration = new Bottom ( this . _options , bound )
191
+ this . _calibration = new Bottom ( this . _options , bound )
192
192
break
193
193
case SnappedDrawer . RIGHT :
194
- this . _callibration = new Right ( this . _options , bound )
194
+ this . _calibration = new Right ( this . _options , bound )
195
195
break
196
196
default :
197
197
throw RangeError ( 'Direction out of range' )
198
198
}
199
199
}
200
200
201
201
_isCoolSignal ( signal ) {
202
- const size = this . _direction === SnappedDrawer . UP || this . _direction === SnappedDrawer . DOWN ? WINDOW . screen . availHeight : WINDOW . screen . availWidth
202
+ const size = this . _direction === SnappedDrawer . UP || this . _direction === SnappedDrawer . DOWN ? WINDOW . screen . height : WINDOW . screen . width
203
203
switch ( this . _direction ) {
204
204
case SnappedDrawer . UP :
205
205
case SnappedDrawer . LEFT :
@@ -238,7 +238,6 @@ export default class SnappedDrawer {
238
238
}
239
239
}
240
240
241
- // private
242
241
_register ( ...handlers ) {
243
242
this . _handlers = handlers
244
243
}
0 commit comments