Skip to content

Commit

Permalink
Merge pull request #89 from ggoffy/master
Browse files Browse the repository at this point in the history
updated viewerjs
  • Loading branch information
ggoffy authored Aug 6, 2022
2 parents 282b5e6 + 3b473e7 commit d26df1e
Show file tree
Hide file tree
Showing 14 changed files with 2,198 additions and 4,862 deletions.
5 changes: 5 additions & 0 deletions assets/gallerytypes/viewerjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.10.5 (Apr 5, 2022)

- Continue to initialize even if some images fail to load in inline mode.
- Avoid conflicts with nested modals (#540).

## 1.10.4 (Feb 13, 2022)

- Use legacy color function notation for better compatibility (#529).
Expand Down
34 changes: 28 additions & 6 deletions assets/gallerytypes/viewerjs/dist/viewer.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.4
* Viewer.js v1.10.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-02-13T08:40:00.127Z
* Date: 2022-04-05T08:21:02.491Z
*/

'use strict';
Expand Down Expand Up @@ -3040,10 +3040,20 @@ var others = {
var viewer = _this.viewer;
var target = event.target;

if (target !== document && target !== viewer && !viewer.contains(target) // Avoid conflicts with other modals (#474)
&& (target.getAttribute('tabindex') === null || target.getAttribute('aria-modal') !== 'true')) {
viewer.focus();
if (target === document || target === viewer || viewer.contains(target)) {
return;
}

while (target) {
// Avoid conflicts with other modals (#474, #540)
if (target.getAttribute('tabindex') !== null || target.getAttribute('aria-modal') === 'true') {
return;
}

target = target.parentElement;
}

viewer.focus();
});
},
clearEnforceFocus: function clearEnforceFocus() {
Expand Down Expand Up @@ -3340,6 +3350,7 @@ var Viewer = /*#__PURE__*/function () {
forEach(images, function (image) {
if (!image.complete) {
removeListener(image, EVENT_LOAD, progress);
removeListener(image, EVENT_ERROR, progress);
}
});
}
Expand All @@ -3348,7 +3359,18 @@ var Viewer = /*#__PURE__*/function () {
if (image.complete) {
progress();
} else {
addListener(image, EVENT_LOAD, progress, {
var onLoad;
var onError;
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);
progress();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);
progress();
}, {
once: true
});
}
Expand Down
5 changes: 3 additions & 2 deletions assets/gallerytypes/viewerjs/dist/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.4
* Viewer.js v1.10.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-02-13T08:39:57.620Z
* Date: 2022-04-05T08:21:00.150Z
*/

.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 Expand Up @@ -329,6 +329,7 @@
}

.viewer-button {
-webkit-app-region: no-drag;
background-color: rgba(0, 0, 0, 50%);
border-radius: 50%;
cursor: pointer;
Expand Down
34 changes: 28 additions & 6 deletions assets/gallerytypes/viewerjs/dist/viewer.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.4
* Viewer.js v1.10.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-02-13T08:40:00.127Z
* Date: 2022-04-05T08:21:02.491Z
*/

function ownKeys(object, enumerableOnly) {
Expand Down Expand Up @@ -3038,10 +3038,20 @@ var others = {
var viewer = _this.viewer;
var target = event.target;

if (target !== document && target !== viewer && !viewer.contains(target) // Avoid conflicts with other modals (#474)
&& (target.getAttribute('tabindex') === null || target.getAttribute('aria-modal') !== 'true')) {
viewer.focus();
if (target === document || target === viewer || viewer.contains(target)) {
return;
}

while (target) {
// Avoid conflicts with other modals (#474, #540)
if (target.getAttribute('tabindex') !== null || target.getAttribute('aria-modal') === 'true') {
return;
}

target = target.parentElement;
}

viewer.focus();
});
},
clearEnforceFocus: function clearEnforceFocus() {
Expand Down Expand Up @@ -3338,6 +3348,7 @@ var Viewer = /*#__PURE__*/function () {
forEach(images, function (image) {
if (!image.complete) {
removeListener(image, EVENT_LOAD, progress);
removeListener(image, EVENT_ERROR, progress);
}
});
}
Expand All @@ -3346,7 +3357,18 @@ var Viewer = /*#__PURE__*/function () {
if (image.complete) {
progress();
} else {
addListener(image, EVENT_LOAD, progress, {
var onLoad;
var onError;
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);
progress();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);
progress();
}, {
once: true
});
}
Expand Down
34 changes: 28 additions & 6 deletions assets/gallerytypes/viewerjs/dist/viewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.4
* Viewer.js v1.10.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2022-02-13T08:40:00.127Z
* Date: 2022-04-05T08:21:02.491Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -3044,10 +3044,20 @@
var viewer = _this.viewer;
var target = event.target;

if (target !== document && target !== viewer && !viewer.contains(target) // Avoid conflicts with other modals (#474)
&& (target.getAttribute('tabindex') === null || target.getAttribute('aria-modal') !== 'true')) {
viewer.focus();
if (target === document || target === viewer || viewer.contains(target)) {
return;
}

while (target) {
// Avoid conflicts with other modals (#474, #540)
if (target.getAttribute('tabindex') !== null || target.getAttribute('aria-modal') === 'true') {
return;
}

target = target.parentElement;
}

viewer.focus();
});
},
clearEnforceFocus: function clearEnforceFocus() {
Expand Down Expand Up @@ -3344,6 +3354,7 @@
forEach(images, function (image) {
if (!image.complete) {
removeListener(image, EVENT_LOAD, progress);
removeListener(image, EVENT_ERROR, progress);
}
});
}
Expand All @@ -3352,7 +3363,18 @@
if (image.complete) {
progress();
} else {
addListener(image, EVENT_LOAD, progress, {
var onLoad;
var onError;
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);
progress();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);
progress();
}, {
once: true
});
}
Expand Down
Loading

0 comments on commit d26df1e

Please sign in to comment.