From 27516e2d166d2370af45da744f507578021bbd67 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 16 Aug 2021 07:04:20 +0200 Subject: [PATCH] scroll navpane to open folder on load --- copyparty/web/browser.css | 5 +++++ copyparty/web/browser.js | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 3bd4df44..b57d352b 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -709,6 +709,10 @@ input.eq_gain { position: sticky; z-index: 1; top: 0; + height: 2.2em; + line-height: 2.2em; + border-bottom: 1px solid #555; + overflow: hidden; } #thx_ff { padding: 5em 0; @@ -1251,6 +1255,7 @@ html.light #files tr.sel a:hover { } html.light #treeh { background: #eee; + border-color: #ddd; } html.light #tree { scrollbar-color: #a70 #ddd; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index e00716e2..07e2bbe1 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -160,6 +160,7 @@ ebi('tree').innerHTML = ( ' +\n' + ' \n' + ' a\n' + + ' v\n' + '\n' + '\n' + '
 
' @@ -2391,7 +2392,8 @@ var thegrid = (function () { })(); -function tree_scrollto() { +function tree_scrollto(e) { + ev(e); var act = QS('#treeul a.hl'), ul = act ? act.offsetParent : null; @@ -2851,7 +2853,7 @@ var treectl = (function () { var treectl = { "hidden": true, "ls_cb": null, - "dir_cb": null + "dir_cb": tree_scrollto }, entreed = false, fixedpos = false, @@ -3239,6 +3241,7 @@ var treectl = (function () { ebi('entree').onclick = treectl.entree; ebi('detree').onclick = treectl.detree; + ebi('visdir').onclick = tree_scrollto; ebi('dotfiles').onclick = tdots; ebi('dyntree').onclick = dyntree; ebi('twig').onclick = scaletree;