11/*!
2- * Viewer.js v1.11.1
2+ * Viewer.js v1.11.2
33 * https://fengyuanchen.github.io/viewerjs
44 *
55 * Copyright 2015-present Chen Fengyuan
66 * Released under the MIT license
77 *
8- * Date: 2022-11-06T05:18:19.939Z
8+ * Date: 2023-01-01T10:14:49.638Z
99 */
1010
1111function ownKeys ( object , enumerableOnly ) {
@@ -49,7 +49,7 @@ function _defineProperties(target, props) {
4949 descriptor . enumerable = descriptor . enumerable || false ;
5050 descriptor . configurable = true ;
5151 if ( "value" in descriptor ) descriptor . writable = true ;
52- Object . defineProperty ( target , descriptor . key , descriptor ) ;
52+ Object . defineProperty ( target , _toPropertyKey ( descriptor . key ) , descriptor ) ;
5353 }
5454}
5555function _createClass ( Constructor , protoProps , staticProps ) {
@@ -61,6 +61,7 @@ function _createClass(Constructor, protoProps, staticProps) {
6161 return Constructor ;
6262}
6363function _defineProperty ( obj , key , value ) {
64+ key = _toPropertyKey ( key ) ;
6465 if ( key in obj ) {
6566 Object . defineProperty ( obj , key , {
6667 value : value ,
@@ -73,6 +74,20 @@ function _defineProperty(obj, key, value) {
7374 }
7475 return obj ;
7576}
77+ function _toPrimitive ( input , hint ) {
78+ if ( typeof input !== "object" || input === null ) return input ;
79+ var prim = input [ Symbol . toPrimitive ] ;
80+ if ( prim !== undefined ) {
81+ var res = prim . call ( input , hint || "default" ) ;
82+ if ( typeof res !== "object" ) return res ;
83+ throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
84+ }
85+ return ( hint === "string" ? String : Number ) ( input ) ;
86+ }
87+ function _toPropertyKey ( arg ) {
88+ var key = _toPrimitive ( arg , "string" ) ;
89+ return typeof key === "symbol" ? key : String ( key ) ;
90+ }
7691
7792var DEFAULTS = {
7893 /**
@@ -1257,7 +1272,9 @@ var handlers = {
12571272 }
12581273 break ;
12591274 case 'hide' :
1260- this . hide ( ) ;
1275+ if ( ! this . pointerMoved ) {
1276+ this . hide ( ) ;
1277+ }
12611278 break ;
12621279 case 'view' :
12631280 this . view ( getData ( target , 'index' ) ) ;
@@ -1478,6 +1495,7 @@ var handlers = {
14781495 pointers = this . pointers ;
14791496 var buttons = event . buttons ,
14801497 button = event . button ;
1498+ this . pointerMoved = false ;
14811499 if ( ! this . viewed || this . showing || this . viewing || this . hiding
14821500
14831501 // Handle mouse event and pointer event and ignore touch event
@@ -1517,6 +1535,7 @@ var handlers = {
15171535 return ;
15181536 }
15191537 event . preventDefault ( ) ;
1538+ this . pointerMoved = true ;
15201539 if ( event . changedTouches ) {
15211540 forEach ( event . changedTouches , function ( touch ) {
15221541 assign ( pointers [ touch . identifier ] || { } , getPointer ( touch , true ) ) ;
@@ -2941,6 +2960,7 @@ var Viewer = /*#__PURE__*/function () {
29412960 this . viewing = false ;
29422961 this . wheeling = false ;
29432962 this . zooming = false ;
2963+ this . pointerMoved = false ;
29442964 this . id = getUniqueID ( ) ;
29452965 this . init ( ) ;
29462966 }
0 commit comments