diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 74bb18d2..a86dcb7f 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -695,7 +695,7 @@ for (var a = 0; a < LANGN.length; a++) function langtest() { var n = LANGS.length - 1; - for (var a = 1; a < LANGS.length; a++) + for (var a = 1; a < LANGS.length; a++) import_js(SR + '/.cpr/tl/' + LANGS[a] + '.js', function () { if (!--n) langtest2(); }); } function langtest2() { @@ -1034,7 +1034,7 @@ ebi('rcm').innerHTML = ( '' + L.rc_cpy + '' + (has(perms, "write") ? '' + L.rc_pst + '' + - '
' + + '' + '' + L.rc_nfo + '' + '' + L.rc_nfi + '' : '') + @@ -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(); @@ -9463,7 +9466,7 @@ var rcm = (function () { }; function mktemp(is_dir) { - var row = mknod('tr', 'temp', + var row = mknod('tr', 'temp', '" + esc(req.responseText) + '');
-
- location.reload();
+ treectl.goto();
};
req.send(data);
}
@@ -9570,10 +9572,10 @@ var rcm = (function () {
default:
console.warn('Invalid rcm option "' + e.target.id + '"');
}
- hide(true);
+ r.hide(true);
};
}
-
+
function show(x, y, target) {
selFile.elem = selFile.type = selFile.path = selFile.id = selFile.relpath = null;
selFile.no_dsel = false;
@@ -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;
})();
diff --git a/copyparty/web/util.js b/copyparty/web/util.js
index a5e6130b..ba9c159f 100644
--- a/copyparty/web/util.js
+++ b/copyparty/web/util.js
@@ -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) {