mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
gallery: fix hotkeys + focus
This commit is contained in:
parent
18676c5e65
commit
af5169f67f
|
@ -83,7 +83,7 @@ window.baguetteBox = (function () {
|
||||||
var trapFocusInsideOverlay = function (event) {
|
var trapFocusInsideOverlay = function (event) {
|
||||||
if (overlay.style.display === 'block' && (overlay.contains && !overlay.contains(event.target))) {
|
if (overlay.style.display === 'block' && (overlay.contains && !overlay.contains(event.target))) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
initFocus();
|
closeButton.focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -378,16 +378,8 @@ window.baguetteBox = (function () {
|
||||||
options.onChange(currentIndex, imagesElements.length);
|
options.onChange(currentIndex, imagesElements.length);
|
||||||
}
|
}
|
||||||
documentLastFocus = document.activeElement;
|
documentLastFocus = document.activeElement;
|
||||||
initFocus();
|
|
||||||
isOverlayVisible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function initFocus() {
|
|
||||||
if (options.buttons) {
|
|
||||||
previousButton.focus();
|
|
||||||
} else {
|
|
||||||
closeButton.focus();
|
closeButton.focus();
|
||||||
}
|
isOverlayVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideOverlay(e) {
|
function hideOverlay(e) {
|
||||||
|
|
|
@ -1756,6 +1756,9 @@ document.onkeydown = function (e) {
|
||||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (QS('#baguetteBox-overlay.visible'))
|
||||||
|
return;
|
||||||
|
|
||||||
var k = e.code + '', pos = -1, n;
|
var k = e.code + '', pos = -1, n;
|
||||||
|
|
||||||
if (e.shiftKey && k != 'KeyA' && k != 'KeyD')
|
if (e.shiftKey && k != 'KeyA' && k != 'KeyD')
|
||||||
|
|
Loading…
Reference in a new issue