Skip to content

Commit fbf17be

Browse files
committed
apply unlist to navpane too
1 parent 3cde1f3 commit fbf17be

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

copyparty/web/browser.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7946,6 +7946,17 @@ var treectl = (function () {
79467946
return toast.err(30, "bad <code>?tree</code> reply;\nexpected json, got this:\n\n" + esc(this.responseText + ''));
79477947
}
79487948
r.rendertree(res, this.ts, this.top, this.dst, this.rst);
7949+
7950+
if (r.lsc && r.lsc.unlist)
7951+
r.prunetree(r.lsc);
7952+
};
7953+
7954+
r.prunetree = function (res) {
7955+
var ptn = new RegExp(res.unlist);
7956+
var els = QSA('#treeul li>a+a');
7957+
for (var a = els.length - 1; a >= 0; a--)
7958+
if (ptn.exec(els[a].textContent) && !els[a].className)
7959+
els[a].closest('ul').removeChild(els[a].closest('li'));
79497960
};
79507961

79517962
r.rendertree = function (res, ts, top0, dst, rst) {
@@ -8233,6 +8244,8 @@ var treectl = (function () {
82338244
}
82348245

82358246
r.rendertree({ "a": dirs }, this.ts, ".", get_evpath() + (dk ? '?k=' + dk : ''));
8247+
if (res.unlist)
8248+
r.prunetree(res);
82368249
}
82378250

82388251
r.gentab(this.top, res);
@@ -8314,7 +8327,7 @@ var treectl = (function () {
83148327
if (res.unlist) {
83158328
var ptn = new RegExp(res.unlist);
83168329
for (var a = nodes.length - 1; a >= 0; a--)
8317-
if (ptn.exec(nodes[a].href.split('?')[0]))
8330+
if (ptn.exec(uricom_dec(nodes[a].href.split('?')[0])))
83188331
nodes.splice(a, 1);
83198332
}
83208333
nodes = sortfiles(nodes);

0 commit comments

Comments
 (0)