mirror of
https://github.com/9001/copyparty.git
synced 2026-01-12 07:44:08 -07:00
rcm: fixes;
* reload with ?ls * menu positioning * close with ESC
This commit is contained in:
parent
82c496092f
commit
05a4472075
|
|
@ -6022,6 +6022,9 @@ var ahotkeys = function (e) {
|
|||
if (ebi('hkhelp'))
|
||||
return qsr('#hkhelp');
|
||||
|
||||
if (ebi('rcm').style.display)
|
||||
return rcm.hide();
|
||||
|
||||
if (toast.visible)
|
||||
return toast.hide();
|
||||
|
||||
|
|
@ -9484,8 +9487,7 @@ var rcm = (function () {
|
|||
return toast.err(3, "a " + (is_dir ? "folder" : "file") + " with that name already exists.");
|
||||
if (req.status < 200 || req.status > 399)
|
||||
return toast.err(3, "couldn't create " + (is_dir ? "folder" : "file") + ": <br><code>" + esc(req.responseText) + '</code>');
|
||||
|
||||
location.reload();
|
||||
treectl.goto();
|
||||
};
|
||||
req.send(data);
|
||||
}
|
||||
|
|
@ -9570,7 +9572,7 @@ var rcm = (function () {
|
|||
default:
|
||||
console.warn('Invalid rcm option "' + e.target.id + '"');
|
||||
}
|
||||
hide(true);
|
||||
r.hide(true);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -9621,7 +9623,7 @@ var rcm = (function () {
|
|||
menu.focus();
|
||||
}
|
||||
|
||||
function hide(force) {
|
||||
r.hide = function (force) {
|
||||
if (!menu.style.display || (!force && menu.contains(document.activeElement)))
|
||||
return;
|
||||
if (selFile.elem && !selFile.no_dsel)
|
||||
|
|
@ -9633,16 +9635,16 @@ var rcm = (function () {
|
|||
|
||||
ebi('wrap').oncontextmenu = function(e) {
|
||||
if (thegrid.en || !r.enabled || e.shiftKey || menu.style.display) {
|
||||
hide(true);
|
||||
r.hide(true);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
ev(e);
|
||||
show(e.clientX, e.clientY, e.target);
|
||||
show(xscroll() + e.clientX, yscroll() + e.clientY, e.target);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
menu.onblur = function() {setTimeout(hide)};
|
||||
menu.onblur = function() {setTimeout(r.hide)};
|
||||
|
||||
return r;
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -594,6 +594,19 @@ function yscroll() {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
function xscroll() {
|
||||
if (document.documentElement.scrollLeft) {
|
||||
return (window.xscroll = function () {
|
||||
return document.documentElement.scrollLeft;
|
||||
})();
|
||||
}
|
||||
if (window.pageXOffset) {
|
||||
return (window.xscroll = function () {
|
||||
return window.pageXOffset;
|
||||
})();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
function showsort(tab) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue