1
1
/*!
2
- * Viewer.js v1.11.0
2
+ * Viewer.js v1.11.1
3
3
* https://fengyuanchen.github.io/viewerjs
4
4
*
5
5
* Copyright 2015-present Chen Fengyuan
6
6
* Released under the MIT license
7
7
*
8
- * Date: 2022-10-16T06:41:28.706Z
8
+ * Date: 2022-11-06T05:18:19.939Z
9
9
*/
10
10
11
11
function ownKeys ( object , enumerableOnly ) {
@@ -644,7 +644,8 @@ var onceSupported = function () {
644
644
* This setter can fix a `TypeError` in strict mode
645
645
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
646
646
* @param {boolean } value - The value to set
647
- */ set : function set ( value ) {
647
+ */
648
+ set : function set ( value ) {
648
649
once = value ;
649
650
}
650
651
} ) ;
@@ -1648,7 +1649,8 @@ var methods = {
1648
1649
/** Show the viewer (only available in modal mode)
1649
1650
* @param {boolean } [immediate=false] - Indicates if show the viewer immediately or not.
1650
1651
* @returns {Viewer } this
1651
- */ show : function show ( ) {
1652
+ */
1653
+ show : function show ( ) {
1652
1654
var immediate = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
1653
1655
var element = this . element ,
1654
1656
options = this . options ;
@@ -1707,7 +1709,8 @@ var methods = {
1707
1709
* Hide the viewer (only available in modal mode)
1708
1710
* @param {boolean } [immediate=false] - Indicates if hide the viewer immediately or not.
1709
1711
* @returns {Viewer } this
1710
- */ hide : function hide ( ) {
1712
+ */
1713
+ hide : function hide ( ) {
1711
1714
var _this = this ;
1712
1715
var immediate = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
1713
1716
var element = this . element ,
@@ -1784,7 +1787,8 @@ var methods = {
1784
1787
* View one of the images with image's index
1785
1788
* @param {number } index - The index of the image to view.
1786
1789
* @returns {Viewer } this
1787
- */ view : function view ( ) {
1790
+ */
1791
+ view : function view ( ) {
1788
1792
var _this2 = this ;
1789
1793
var index = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : this . options . initialViewIndex ;
1790
1794
index = Number ( index ) || 0 ;
@@ -1923,7 +1927,8 @@ var methods = {
1923
1927
* @param {boolean } [loop=false] - Indicate if view the last one
1924
1928
* when it is the first one at present.
1925
1929
* @returns {Viewer } this
1926
- */ prev : function prev ( ) {
1930
+ */
1931
+ prev : function prev ( ) {
1927
1932
var loop = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
1928
1933
var index = this . index - 1 ;
1929
1934
if ( index < 0 ) {
@@ -1937,7 +1942,8 @@ var methods = {
1937
1942
* @param {boolean } [loop=false] - Indicate if view the first one
1938
1943
* when it is the last one at present.
1939
1944
* @returns {Viewer } this
1940
- */ next : function next ( ) {
1945
+ */
1946
+ next : function next ( ) {
1941
1947
var loop = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
1942
1948
var maxIndex = this . length - 1 ;
1943
1949
var index = this . index + 1 ;
@@ -1952,7 +1958,8 @@ var methods = {
1952
1958
* @param {number } x - The moving distance in the horizontal direction.
1953
1959
* @param {number } [y=x] The moving distance in the vertical direction.
1954
1960
* @returns {Viewer } this
1955
- */ move : function move ( x ) {
1961
+ */
1962
+ move : function move ( x ) {
1956
1963
var y = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : x ;
1957
1964
var imageData = this . imageData ;
1958
1965
this . moveTo ( isUndefined ( x ) ? x : imageData . x + Number ( x ) , isUndefined ( y ) ? y : imageData . y + Number ( y ) ) ;
@@ -1964,7 +1971,8 @@ var methods = {
1964
1971
* @param {number } [y=x] - The new position in the vertical direction.
1965
1972
* @param {Event } [_originalEvent=null] - The original event if any.
1966
1973
* @returns {Viewer } this
1967
- */ moveTo : function moveTo ( x ) {
1974
+ */
1975
+ moveTo : function moveTo ( x ) {
1968
1976
var _this3 = this ;
1969
1977
var y = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : x ;
1970
1978
var _originalEvent = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : null ;
@@ -2032,15 +2040,17 @@ var methods = {
2032
2040
* Rotate the image with a relative degree.
2033
2041
* @param {number } degree - The rotate degree.
2034
2042
* @returns {Viewer } this
2035
- */ rotate : function rotate ( degree ) {
2043
+ */
2044
+ rotate : function rotate ( degree ) {
2036
2045
this . rotateTo ( ( this . imageData . rotate || 0 ) + Number ( degree ) ) ;
2037
2046
return this ;
2038
2047
} ,
2039
2048
/**
2040
2049
* Rotate the image to an absolute degree.
2041
2050
* @param {number } degree - The rotate degree.
2042
2051
* @returns {Viewer } this
2043
- */ rotateTo : function rotateTo ( degree ) {
2052
+ */
2053
+ rotateTo : function rotateTo ( degree ) {
2044
2054
var _this4 = this ;
2045
2055
var element = this . element ,
2046
2056
options = this . options ,
@@ -2082,15 +2092,17 @@ var methods = {
2082
2092
* Scale the image on the x-axis.
2083
2093
* @param {number } scaleX - The scale ratio on the x-axis.
2084
2094
* @returns {Viewer } this
2085
- */ scaleX : function scaleX ( _scaleX ) {
2095
+ */
2096
+ scaleX : function scaleX ( _scaleX ) {
2086
2097
this . scale ( _scaleX , this . imageData . scaleY ) ;
2087
2098
return this ;
2088
2099
} ,
2089
2100
/**
2090
2101
* Scale the image on the y-axis.
2091
2102
* @param {number } scaleY - The scale ratio on the y-axis.
2092
2103
* @returns {Viewer } this
2093
- */ scaleY : function scaleY ( _scaleY ) {
2104
+ */
2105
+ scaleY : function scaleY ( _scaleY ) {
2094
2106
this . scale ( this . imageData . scaleX , _scaleY ) ;
2095
2107
return this ;
2096
2108
} ,
@@ -2099,7 +2111,8 @@ var methods = {
2099
2111
* @param {number } scaleX - The scale ratio on the x-axis.
2100
2112
* @param {number } [scaleY=scaleX] - The scale ratio on the y-axis.
2101
2113
* @returns {Viewer } this
2102
- */ scale : function scale ( scaleX ) {
2114
+ */
2115
+ scale : function scale ( scaleX ) {
2103
2116
var _this5 = this ;
2104
2117
var scaleY = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : scaleX ;
2105
2118
var element = this . element ,
@@ -2165,7 +2178,8 @@ var methods = {
2165
2178
* @param {Object } [pivot] - The pivot point coordinate for zooming.
2166
2179
* @param {Event } [_originalEvent=null] - The original event if any.
2167
2180
* @returns {Viewer } this
2168
- */ zoom : function zoom ( ratio ) {
2181
+ */
2182
+ zoom : function zoom ( ratio ) {
2169
2183
var showTooltip = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
2170
2184
var pivot = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : null ;
2171
2185
var _originalEvent = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : null ;
@@ -2187,7 +2201,8 @@ var methods = {
2187
2201
* @param {Event } [_originalEvent=null] - The original event if any.
2188
2202
* @param {Event } [_zoomable=false] - Indicates if the current zoom is available or not.
2189
2203
* @returns {Viewer } this
2190
- */ zoomTo : function zoomTo ( ratio ) {
2204
+ */
2205
+ zoomTo : function zoomTo ( ratio ) {
2191
2206
var _this6 = this ;
2192
2207
var showTooltip = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
2193
2208
var pivot = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : null ;
@@ -2293,7 +2308,8 @@ var methods = {
2293
2308
* Play the images
2294
2309
* @param {boolean|FullscreenOptions } [fullscreen=false] - Indicate if request fullscreen or not.
2295
2310
* @returns {Viewer } this
2296
- */ play : function play ( ) {
2311
+ */
2312
+ play : function play ( ) {
2297
2313
var _this7 = this ;
2298
2314
var fullscreen = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
2299
2315
if ( ! this . isShown || this . played ) {
@@ -2542,7 +2558,8 @@ var methods = {
2542
2558
* Toggle the image size between its current size and natural size
2543
2559
* @param {Event } [_originalEvent=null] - The original event if any.
2544
2560
* @returns {Viewer } this
2545
- */ toggle : function toggle ( ) {
2561
+ */
2562
+ toggle : function toggle ( ) {
2546
2563
var _originalEvent = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : null ;
2547
2564
if ( this . imageData . ratio === 1 ) {
2548
2565
this . zoomTo ( this . imageData . oldRatio , true , null , _originalEvent ) ;
0 commit comments