fix search expander state loading

This commit is contained in:
Til Schmitter 2026-04-25 16:57:57 +02:00
parent 1dac98e5b3
commit 96ae3ff23d
2 changed files with 24 additions and 48 deletions

View file

@ -1569,7 +1569,7 @@ html.a #up_quick .btn.on {
}
.opview {
display: none;
margin-bottom: .5em;
margin-bottom: 1em;
}
.opview.act {
display: block;
@ -2174,6 +2174,7 @@ html.y #tree.nowrap .ntree a+a:hover {
#hdoc,
#ghead {
position: sticky;
margin-top: -.5em;
top: 3.7em;
z-index: 3;
transition: opacity .15s;
@ -3713,7 +3714,7 @@ html.e #wrap.thin {
margin: 0em -0.5em;
}
#ghead {
margin: .5em;
margin: 0 .5em 1em .5em;
}
.modalsplit {
display: block;
@ -4145,7 +4146,6 @@ html.e #acc_info {
html.e #acc_info,
html.e #ops,
html.e #srv_info {
display: flex;
align-items: center;
}
html.e .overlay_plus {
@ -4216,17 +4216,22 @@ html.e #ops a {
}
}
html.e #ops {
background: var(--ttlbar);
/*HC*/
box-shadow: inset 0-1px grey, inset 0-2px var(--shadow-color-1);
height: 2em;
gap: 0.6em;
padding: 0.2em;
margin-bottom: 1.2em;
width: 100%;
position: absolute;
justify-content: end;
font-size: larger;
padding: 0;
}
html.e #srchfolder_div {
left: 2em;
top: -.1em;
bottom: -.6em;
}
html.e #qs_btns {
right: 0.7em;
top: .3em;
}
html.e .under {
border: var(--fg) solid 1px;
}
html.e #srch_form,
html.e .opbox {

View file

@ -6938,11 +6938,13 @@ var search_ui = (function () {
}
folderSearch.onkeydown = ev_search_keydown;
var expand = sread('s_ex');
function exp_search () {
clmod(ebi('op_search'), 'vis', expand);
var expand = sread('s_ex') == 'true';
exp_search(expand);
function exp_search (e) {
clmod(ebi('op_search'), 'vis', e);
var ms = ebi('moresearch');
if(expand){
if(e){
location.hash = '#';
ms.innerHTML = '▴'
}
@ -6953,9 +6955,8 @@ var search_ui = (function () {
ebi('moresearch').onclick = function () {
expand = !expand;
swrite('s_ex', expand);
exp_search();
}
exp_search();
exp_search(expand);
};
ebi('closesearch').onclick = function (e) {
ebi('opa_srch').click();
@ -7666,36 +7667,6 @@ var treectl = (function () {
if (parp.style.top != y)
parp.style.top = y;
}
return; // always fixed
if (wraptop === null)
return;
prev_atop = atop;
prev_winh = winh;
if (fixedpos && atop >= 0) {
tree.style.position = 'absolute';
tree.style.bottom = '';
fixedpos = false;
}
else if (!fixedpos && atop < 0) {
tree.style.position = 'fixed';
tree.style.height = 'auto';
fixedpos = true;
}
if (fixedpos) {
tree.style.top = Math.max(0, parseInt(atop)) + 'px';
}
else {
var top = Math.max(0, wraptop),
treeh = winh - atop;
tree.style.top = top + 'px';
// setting the height causes scrollbars to appear often because it's not exact most of the time
tree.style.height = winh - wraptop + Math.floor(yscroll()) - 2 + 'px'; //= treeh < 10 ? '' : Math.floor(treeh) + 'px';
}
}
timer.add(onscroll2, true);