Skip to content

Commit

Permalink
build: release 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Jan 1, 2023
1 parent 299dae8 commit 00ace6b
Show file tree
Hide file tree
Showing 12 changed files with 1,374 additions and 955 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## next
## 1.11.2 (Jan 1, 2023)

- Do not close the viewer when dragging the image on the backdrop (#577).

Expand Down
28 changes: 24 additions & 4 deletions dist/viewer.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.11.1
* Viewer.js v1.11.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-11-06T05:18:19.939Z
* Date: 2023-01-01T10:14:49.638Z
*/

'use strict';
Expand Down Expand Up @@ -51,7 +51,7 @@ function _defineProperties(target, props) {
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
Expand All @@ -63,6 +63,7 @@ function _createClass(Constructor, protoProps, staticProps) {
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
Expand All @@ -75,6 +76,20 @@ function _defineProperty(obj, key, value) {
}
return obj;
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

var DEFAULTS = {
/**
Expand Down Expand Up @@ -1259,7 +1274,9 @@ var handlers = {
}
break;
case 'hide':
this.hide();
if (!this.pointerMoved) {
this.hide();
}
break;
case 'view':
this.view(getData(target, 'index'));
Expand Down Expand Up @@ -1480,6 +1497,7 @@ var handlers = {
pointers = this.pointers;
var buttons = event.buttons,
button = event.button;
this.pointerMoved = false;
if (!this.viewed || this.showing || this.viewing || this.hiding

// Handle mouse event and pointer event and ignore touch event
Expand Down Expand Up @@ -1519,6 +1537,7 @@ var handlers = {
return;
}
event.preventDefault();
this.pointerMoved = true;
if (event.changedTouches) {
forEach(event.changedTouches, function (touch) {
assign(pointers[touch.identifier] || {}, getPointer(touch, true));
Expand Down Expand Up @@ -2943,6 +2962,7 @@ var Viewer = /*#__PURE__*/function () {
this.viewing = false;
this.wheeling = false;
this.zooming = false;
this.pointerMoved = false;
this.id = getUniqueID();
this.init();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.11.1
* Viewer.js v1.11.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-11-06T05:18:17.414Z
* Date: 2023-01-01T10:14:47.694Z
*/

.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {
Expand Down
28 changes: 24 additions & 4 deletions dist/viewer.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.11.1
* Viewer.js v1.11.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-11-06T05:18:19.939Z
* Date: 2023-01-01T10:14:49.638Z
*/

function ownKeys(object, enumerableOnly) {
Expand Down Expand Up @@ -49,7 +49,7 @@ function _defineProperties(target, props) {
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
Expand All @@ -61,6 +61,7 @@ function _createClass(Constructor, protoProps, staticProps) {
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
Expand All @@ -73,6 +74,20 @@ function _defineProperty(obj, key, value) {
}
return obj;
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

var DEFAULTS = {
/**
Expand Down Expand Up @@ -1257,7 +1272,9 @@ var handlers = {
}
break;
case 'hide':
this.hide();
if (!this.pointerMoved) {
this.hide();
}
break;
case 'view':
this.view(getData(target, 'index'));
Expand Down Expand Up @@ -1478,6 +1495,7 @@ var handlers = {
pointers = this.pointers;
var buttons = event.buttons,
button = event.button;
this.pointerMoved = false;
if (!this.viewed || this.showing || this.viewing || this.hiding

// Handle mouse event and pointer event and ignore touch event
Expand Down Expand Up @@ -1517,6 +1535,7 @@ var handlers = {
return;
}
event.preventDefault();
this.pointerMoved = true;
if (event.changedTouches) {
forEach(event.changedTouches, function (touch) {
assign(pointers[touch.identifier] || {}, getPointer(touch, true));
Expand Down Expand Up @@ -2941,6 +2960,7 @@ var Viewer = /*#__PURE__*/function () {
this.viewing = false;
this.wheeling = false;
this.zooming = false;
this.pointerMoved = false;
this.id = getUniqueID();
this.init();
}
Expand Down
28 changes: 24 additions & 4 deletions dist/viewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.11.1
* Viewer.js v1.11.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-11-06T05:18:19.939Z
* Date: 2023-01-01T10:14:49.638Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -55,7 +55,7 @@
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
Expand All @@ -67,6 +67,7 @@
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
Expand All @@ -79,6 +80,20 @@
}
return obj;
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

var DEFAULTS = {
/**
Expand Down Expand Up @@ -1263,7 +1278,9 @@
}
break;
case 'hide':
this.hide();
if (!this.pointerMoved) {
this.hide();
}
break;
case 'view':
this.view(getData(target, 'index'));
Expand Down Expand Up @@ -1484,6 +1501,7 @@
pointers = this.pointers;
var buttons = event.buttons,
button = event.button;
this.pointerMoved = false;
if (!this.viewed || this.showing || this.viewing || this.hiding

// Handle mouse event and pointer event and ignore touch event
Expand Down Expand Up @@ -1523,6 +1541,7 @@
return;
}
event.preventDefault();
this.pointerMoved = true;
if (event.changedTouches) {
forEach(event.changedTouches, function (touch) {
assign(pointers[touch.identifier] || {}, getPointer(touch, true));
Expand Down Expand Up @@ -2947,6 +2966,7 @@
this.viewing = false;
this.wheeling = false;
this.zooming = false;
this.pointerMoved = false;
this.id = getUniqueID();
this.init();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/viewer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/viewer.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/dist/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.11.1
* Viewer.js v1.11.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-11-06T05:18:17.414Z
* Date: 2023-01-01T10:14:47.694Z
*/

.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Viewer.js <small class="h6">v1.11.1</small></h1>
<h1>Viewer.js <small class="h6">v1.11.2</small></h1>
<p class="lead">JavaScript image viewer.</p>
</div>
<div class="col-md">
Expand Down
Loading

0 comments on commit 00ace6b

Please sign in to comment.