@@ -581,6 +581,10 @@ define([
581
581
var imgOriginalSize = getImageSize ( $image [ 0 ] . src ) ,
582
582
proportions ;
583
583
584
+ if ( imgOriginalSize . rh < $image . parent ( ) . height ( ) && imgOriginalSize . rw < $image . parent ( ) . width ( ) ) {
585
+ return ;
586
+ }
587
+
584
588
proportions = imgOriginalSize . rw / imgOriginalSize . rh ;
585
589
586
590
if ( allowZoomIn ) {
@@ -594,15 +598,17 @@ define([
594
598
}
595
599
}
596
600
597
- function detectDoubleTap ( e ) {
601
+ function detectDoubleTap ( e ) {
598
602
var now = new Date ( ) . getTime ( ) ,
599
603
timesince = now - tapFlag ;
600
604
601
- if ( timesince < 500 && timesince > 0 ) {
605
+ if ( timesince < 400 && timesince > 0 ) {
602
606
transitionActive = false ;
607
+ tapFlag = 0 ;
603
608
dblClickHandler ( e ) ;
609
+ } else {
610
+ tapFlag = new Date ( ) . getTime ( ) ;
604
611
}
605
- tapFlag = new Date ( ) . getTime ( ) ;
606
612
}
607
613
608
614
$image . unbind ( 'dblclick' ) ;
@@ -775,9 +781,9 @@ define([
775
781
}
776
782
} ) ;
777
783
778
- isTouchEnabled && $image . off ( 'touchend ' ) ;
779
- isTouchEnabled && $image . on ( 'touchend ' , function ( e ) {
780
- if ( e . originalEvent . touches . length === 0 ) {
784
+ isTouchEnabled && $image . off ( 'tap ' ) ;
785
+ isTouchEnabled && $image . on ( 'tap ' , function ( e ) {
786
+ if ( e . originalEvent . originalEvent . touches . length === 0 ) {
781
787
detectDoubleTap ( e ) ;
782
788
}
783
789
} ) ;
0 commit comments