@@ -32,7 +32,7 @@ import {
32
32
33
33
export default {
34
34
click ( event ) {
35
- const { options, imageData, ignoreCloseOnceMoved } = this ;
35
+ const { options, imageData } = this ;
36
36
let { target } = event ;
37
37
let action = getData ( target , DATA_ACTION ) ;
38
38
@@ -63,7 +63,7 @@ export default {
63
63
break ;
64
64
65
65
case 'hide' :
66
- if ( ignoreCloseOnceMoved !== true ) {
66
+ if ( ! this . pointerMoved ) {
67
67
this . hide ( ) ;
68
68
}
69
69
break ;
@@ -337,6 +337,8 @@ export default {
337
337
const { options, pointers } = this ;
338
338
const { buttons, button } = event ;
339
339
340
+ this . pointerMoved = false ;
341
+
340
342
if (
341
343
! this . viewed
342
344
|| this . showing
@@ -393,6 +395,7 @@ export default {
393
395
}
394
396
395
397
event . preventDefault ( ) ;
398
+ this . pointerMoved = true ;
396
399
397
400
if ( event . changedTouches ) {
398
401
forEach ( event . changedTouches , ( touch ) => {
@@ -406,9 +409,7 @@ export default {
406
409
} ,
407
410
408
411
pointerup ( event ) {
409
- const {
410
- options, action, pointers, ignoreCloseOnceMoved,
411
- } = this ;
412
+ const { options, action, pointers } = this ;
412
413
let pointer ;
413
414
414
415
if ( event . changedTouches ) {
@@ -421,12 +422,6 @@ export default {
421
422
delete pointers [ event . pointerId || 0 ] ;
422
423
}
423
424
424
- if ( ignoreCloseOnceMoved ) {
425
- setTimeout ( ( ) => {
426
- this . ignoreCloseOnceMoved = false ;
427
- } ) ;
428
- }
429
-
430
425
if ( ! action ) {
431
426
return ;
432
427
}
0 commit comments