mirror of
https://github.com/9001/copyparty.git
synced 2026-01-12 15:52:39 -07:00
dropdown grid view fix
This commit is contained in:
parent
5b2c84752d
commit
54d2a8a109
|
|
@ -9570,24 +9570,43 @@ var rcm = (function () {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function show(x, y, target) {
|
function show(x, y, target, isGrid) {
|
||||||
selFile.elem = selFile.type = selFile.path = selFile.id = selFile.relpath = null;
|
selFile.elem = selFile.type = selFile.path = selFile.id = selFile.relpath = null;
|
||||||
selFile.no_dsel = false;
|
selFile.no_dsel = false;
|
||||||
if (target) {
|
if (target) {
|
||||||
var file = target.closest("#files tbody tr");
|
if (isGrid && target.matches && target.matches('#ggrid > a')) {
|
||||||
if (file) {
|
var ref = target.getAttribute('ref');
|
||||||
selFile.no_dsel = clgot(file, "sel");
|
var file = ebi(ref) && ebi(ref).closest('#files tbody tr');
|
||||||
clmod(file, "sel", true);
|
if (file) {
|
||||||
selFile.elem = file;
|
selFile.no_dsel = clgot(file, "sel");
|
||||||
|
clmod(file, "sel", true);
|
||||||
|
selFile.elem = file;
|
||||||
|
selFile.path = basenames(file.children[1].firstChild.href).split('?')[0];
|
||||||
|
selFile.relpath = selFile.path.split('/').slice(-1)[0];
|
||||||
|
if (noq_href(file.children[1].firstChild).endsWith("/"))
|
||||||
|
selFile.type = "dir";
|
||||||
|
else {
|
||||||
|
var lead = file.firstChild.firstChild;
|
||||||
|
selFile.id = lead.id.split('-')[1];
|
||||||
|
selFile.type = lead.innerHTML[0] == '(' ? 'gf' : lead.id.split('-')[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var file = target.closest("#files tbody tr");
|
||||||
|
if (file) {
|
||||||
|
selFile.no_dsel = clgot(file, "sel");
|
||||||
|
clmod(file, "sel", true);
|
||||||
|
selFile.elem = file;
|
||||||
|
|
||||||
selFile.path = basenames(file.children[1].firstChild.href).split('?')[0];
|
selFile.path = basenames(file.children[1].firstChild.href).split('?')[0];
|
||||||
selFile.relpath = selFile.path.split('/').slice(-1)[0];
|
selFile.relpath = selFile.path.split('/').slice(-1)[0];
|
||||||
if (noq_href(file.children[1].firstChild).endsWith("/"))
|
if (noq_href(file.children[1].firstChild).endsWith("/"))
|
||||||
selFile.type = "dir";
|
selFile.type = "dir";
|
||||||
else {
|
else {
|
||||||
var lead = file.firstChild.firstChild;
|
var lead = file.firstChild.firstChild;
|
||||||
selFile.id = lead.id.split('-')[1];
|
selFile.id = lead.id.split('-')[1];
|
||||||
selFile.type = lead.innerHTML[0] == '(' ? 'gf' : lead.id.split('-')[0];
|
selFile.type = lead.innerHTML[0] == '(' ? 'gf' : lead.id.split('-')[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9623,28 +9642,31 @@ var rcm = (function () {
|
||||||
return;
|
return;
|
||||||
if (selFile.elem && !selFile.no_dsel)
|
if (selFile.elem && !selFile.no_dsel)
|
||||||
clmod(selFile.elem, "sel", false);
|
clmod(selFile.elem, "sel", false);
|
||||||
|
msel.selui();
|
||||||
selFile.elem = selFile.type = selFile.path = selFile.id = selFile.relpath = null;
|
selFile.elem = selFile.type = selFile.path = selFile.id = selFile.relpath = null;
|
||||||
selFile.no_dsel = false;
|
selFile.no_dsel = false;
|
||||||
menu.style.display = '';
|
menu.style.display = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
ebi('wrap').oncontextmenu = function(e) {
|
ebi('wrap').oncontextmenu = function(e) {
|
||||||
if (thegrid.en || !r.enabled || e.shiftKey || menu.style.display) {
|
if (!r.enabled || e.shiftKey || menu.style.display) {
|
||||||
r.hide(true);
|
r.hide(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
ev(e);
|
||||||
ev(e);
|
var gridItem = e.target.closest('#ggrid > a');
|
||||||
show(xscroll() + e.clientX, yscroll() + e.clientY, e.target);
|
if (thegrid.en && gridItem) {
|
||||||
|
show(xscroll() + e.clientX, yscroll() + e.clientY, gridItem, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
show(xscroll() + e.clientX, yscroll() + e.clientY, e.target, false);
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
menu.onblur = function() {setTimeout(r.hide)};
|
menu.onblur = function() {setTimeout(r.hide)};
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
function reload_mp() {
|
function reload_mp() {
|
||||||
if (mp && mp.au) {
|
if (mp && mp.au) {
|
||||||
mpo.au = mp.au;
|
mpo.au = mp.au;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue