@@ -611,8 +611,17 @@ define([
611
611
}
612
612
}
613
613
614
- $image . unbind ( 'dblclick' ) ;
615
- $image . dblclick ( dblClickHandler ) ;
614
+ if ( isTouchEnabled ) {
615
+ $image . off ( 'tap' ) ;
616
+ $image . on ( 'tap' , function ( e ) {
617
+ if ( e . originalEvent . originalEvent . touches . length === 0 ) {
618
+ detectDoubleTap ( e ) ;
619
+ }
620
+ } ) ;
621
+ } else {
622
+ $image . unbind ( 'dblclick' ) ;
623
+ $image . dblclick ( dblClickHandler ) ;
624
+ }
616
625
617
626
if ( gallery . fullScreen ) {
618
627
toggleZoomButtons ( $image , isTouchEnabled , checkForVideo ( fotorama . activeFrame . $stageFrame ) ) ;
@@ -781,13 +790,6 @@ define([
781
790
}
782
791
} ) ;
783
792
784
- isTouchEnabled && $image . off ( 'tap' ) ;
785
- isTouchEnabled && $image . on ( 'tap' , function ( e ) {
786
- if ( e . originalEvent . originalEvent . touches . length === 0 ) {
787
- detectDoubleTap ( e ) ;
788
- }
789
- } ) ;
790
-
791
793
$ ( window ) . resize ( function ( ) {
792
794
toggleZoomButtons ( $image , isTouchEnabled , checkForVideo ( fotorama . activeFrame . $stageFrame ) ) ;
793
795
calculateMinSize ( $image ) ;
@@ -930,13 +932,19 @@ define([
930
932
} )
931
933
. on ( 'fotorama:fullscreenenter fotorama:showend' , function ( e , fotorama ) {
932
934
hideMagnifier ( ) ;
933
- resetVars ( $ ( fullscreenImageSelector ) ) ;
935
+
936
+ if ( ! $ ( fullscreenImageSelector ) . is ( $prevImage ) ) {
937
+ resetVars ( $ ( fullscreenImageSelector ) ) ;
938
+ }
934
939
magnifierFullscreen ( fotorama ) ;
935
940
mousewheel ( e , fotorama , element ) ;
936
941
937
942
if ( $prevImage ) {
938
943
calculateMinSize ( $prevImage ) ;
939
- resetVars ( $prevImage ) ;
944
+
945
+ if ( ! $ ( fullscreenImageSelector ) . is ( $prevImage ) ) {
946
+ resetVars ( $prevImage ) ;
947
+ }
940
948
}
941
949
942
950
toggleStandartNavigation ( ) ;
@@ -948,9 +956,8 @@ define([
948
956
magnifierFullscreen ( fotorama ) ;
949
957
} )
950
958
. on ( 'fotorama:show' , function ( e , fotorama ) {
951
- $prevImage = $ ( fullscreenImageSelector ) ;
959
+ $prevImage = _ . clone ( $ ( fullscreenImageSelector ) ) ;
952
960
hideMagnifier ( ) ;
953
- resetVars ( $ ( fullscreenImageSelector ) ) ;
954
961
} )
955
962
. on ( 'fotorama:fullscreenexit' , function ( e , fotorama ) {
956
963
resetVars ( $ ( fullscreenImageSelector ) ) ;
0 commit comments