mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
close misc views on escape
This commit is contained in:
parent
615929268a
commit
31f3895f40
|
@ -237,7 +237,7 @@ window.baguetteBox = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyDownHandler(e) {
|
function keyDownHandler(e) {
|
||||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing || modal.busy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var k = e.code + '', v = vid();
|
var k = e.code + '', v = vid();
|
||||||
|
|
|
@ -2640,7 +2640,7 @@ var thegrid = (function () {
|
||||||
gfiles.style.display = 'none';
|
gfiles.style.display = 'none';
|
||||||
gfiles.innerHTML = (
|
gfiles.innerHTML = (
|
||||||
'<div id="ghead" class="ghead">' +
|
'<div id="ghead" class="ghead">' +
|
||||||
'<a href="#" class="tgl btn" id="gridsel" tt="enable file selection; ctrl-click a file to override$NHotkey: S">multiselect</a> <span>zoom: ' +
|
'<a href="#" class="tgl btn" id="gridsel" tt="enable file selection; ctrl-click a file to override$N$N<em>when active: doubleclick a file/folder to open it</em>$N$NHotkey: S">multiselect</a> <span>zoom: ' +
|
||||||
'<a href="#" class="btn" z="-1.2" tt="Hotkey: shift-A">–</a> ' +
|
'<a href="#" class="btn" z="-1.2" tt="Hotkey: shift-A">–</a> ' +
|
||||||
'<a href="#" class="btn" z="1.2" tt="Hotkey: shift-D">+</a></span> <span>chop: ' +
|
'<a href="#" class="btn" z="1.2" tt="Hotkey: shift-D">+</a></span> <span>chop: ' +
|
||||||
'<a href="#" class="btn" l="-1" tt="truncate filenames more (show less)">–</a> ' +
|
'<a href="#" class="btn" l="-1" tt="truncate filenames more (show less)">–</a> ' +
|
||||||
|
@ -3041,17 +3041,31 @@ function tree_up() {
|
||||||
|
|
||||||
|
|
||||||
document.onkeydown = function (e) {
|
document.onkeydown = function (e) {
|
||||||
var ae = document.activeElement, aet = '';
|
|
||||||
if (ae && ae != document.body)
|
|
||||||
aet = ae.nodeName.toLowerCase();
|
|
||||||
|
|
||||||
if (e.altKey || e.isComposing)
|
if (e.altKey || e.isComposing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (QS('#bbox-overlay.visible'))
|
if (QS('#bbox-overlay.visible') || modal.busy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var k = e.code + '', pos = -1, n;
|
var k = e.code + '',
|
||||||
|
pos = -1,
|
||||||
|
n,
|
||||||
|
ae = document.activeElement,
|
||||||
|
aet = ae && ae != document.body ? ae.nodeName.toLowerCase() : '';
|
||||||
|
|
||||||
|
if (k == 'Escape') {
|
||||||
|
if (QS('.opview.act'))
|
||||||
|
return QS('#ops>a').click();
|
||||||
|
|
||||||
|
if (widget.is_open)
|
||||||
|
return widget.close();
|
||||||
|
|
||||||
|
if (!treectl.hidden)
|
||||||
|
return treectl.detree();
|
||||||
|
|
||||||
|
if (thegrid.en)
|
||||||
|
return ebi('griden').click();
|
||||||
|
}
|
||||||
|
|
||||||
if (aet == 'tr' && ae.closest('#files')) {
|
if (aet == 'tr' && ae.closest('#files')) {
|
||||||
var d = '';
|
var d = '';
|
||||||
|
|
Loading…
Reference in a new issue