hilight parents of current folder

This commit is contained in:
ed 2021-11-06 00:00:04 +01:00
parent c3add751e5
commit 730b1fff71
2 changed files with 19 additions and 6 deletions

View file

@ -750,6 +750,9 @@ input.eq_gain {
background: #fc4; background: #fc4;
text-shadow: none; text-shadow: none;
} }
#tree ul a.par {
color: #fff;
}
#tree ul a { #tree ul a {
border-radius: .3em; border-radius: .3em;
display: inline-block; display: inline-block;
@ -772,7 +775,7 @@ html.light #tree.nowrap .ntree a+a:hover {
color: #000; color: #000;
} }
#docul a:hover, #docul a:hover,
.ntree a+a:hover { #tree .ntree a+a:hover {
background: #181818; background: #181818;
color: #fff; color: #fff;
} }
@ -1223,6 +1226,9 @@ html.light #tree ul a.hl {
background: #07a; background: #07a;
color: #fff; color: #fff;
} }
html.light #tree ul a.par {
color: #000;
}
html.light #tree ul a.hl:hover { html.light #tree ul a.hl:hover {
background: #059; background: #059;
} }

View file

@ -199,7 +199,7 @@ ebi('tree').innerHTML = (
' <a href="#" class="tgl btn" id="wraptree" tt="word wrap">↵</a>\n' + ' <a href="#" class="tgl btn" id="wraptree" tt="word wrap">↵</a>\n' +
' <a href="#" class="tgl btn" id="hovertree" tt="reveal overflowing lines on hover$N( breaks scrolling unless mouse $N&nbsp; cursor is in the left gutter )">👀</a>\n' + ' <a href="#" class="tgl btn" id="hovertree" tt="reveal overflowing lines on hover$N( breaks scrolling unless mouse $N&nbsp; cursor is in the left gutter )">👀</a>\n' +
'</div>\n' + '</div>\n' +
'<ul class="ntree" id="docul"></ul>\n' + '<ul id="docul"></ul>\n' +
'<ul class="ntree" id="treepar"></ul>\n' + '<ul class="ntree" id="treepar"></ul>\n' +
'<ul class="ntree" id="treeul"></ul>\n' + '<ul class="ntree" id="treeul"></ul>\n' +
'<div id="thx_ff">&nbsp;</div>' '<div id="thx_ff">&nbsp;</div>'
@ -3571,11 +3571,18 @@ var treectl = (function () {
act = null; act = null;
for (var a = 0, aa = links.length; a < aa; a++) { for (var a = 0, aa = links.length; a < aa; a++) {
var href = uricom_dec(links[a].getAttribute('href'))[0]; var href = uricom_dec(links[a].getAttribute('href'))[0],
if (href == cdir) cl = '';
act = links[a];
links[a].setAttribute('class', href == cdir ? 'hl' : ''); if (href == cdir) {
act = links[a];
cl = 'hl';
}
else if (cdir.startsWith(href)) {
cl = 'par';
}
links[a].setAttribute('class', cl);
links[a].onclick = treego; links[a].onclick = treego;
links[a].onmouseenter = nowrap ? menter : null; links[a].onmouseenter = nowrap ? menter : null;
links[a].onmouseleave = nowrap ? mleave : null; links[a].onmouseleave = nowrap ? mleave : null;