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

View file

@ -6938,11 +6938,13 @@ var search_ui = (function () {
} }
folderSearch.onkeydown = ev_search_keydown; folderSearch.onkeydown = ev_search_keydown;
var expand = sread('s_ex'); var expand = sread('s_ex') == 'true';
function exp_search () { exp_search(expand);
clmod(ebi('op_search'), 'vis', expand); function exp_search (e) {
clmod(ebi('op_search'), 'vis', e);
var ms = ebi('moresearch'); var ms = ebi('moresearch');
if(expand){ if(e){
location.hash = '#'; location.hash = '#';
ms.innerHTML = '▴' ms.innerHTML = '▴'
} }
@ -6953,9 +6955,8 @@ var search_ui = (function () {
ebi('moresearch').onclick = function () { ebi('moresearch').onclick = function () {
expand = !expand; expand = !expand;
swrite('s_ex', expand); swrite('s_ex', expand);
exp_search(); exp_search(expand);
} };
exp_search();
ebi('closesearch').onclick = function (e) { ebi('closesearch').onclick = function (e) {
ebi('opa_srch').click(); ebi('opa_srch').click();
@ -7666,36 +7667,6 @@ var treectl = (function () {
if (parp.style.top != y) if (parp.style.top != y)
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); timer.add(onscroll2, true);