diff options
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -175,7 +175,17 @@ let DayDigest = { let account = posts[0].account; return m("details.acct", {key: user}, [ - m("summary.acct__header", [ + m("summary.acct__header", { + onclick: (ev) => { + // Don't jump around when closing an acount which we see + // only due to position:sticky; + let el = ev.target.parentElement; + let el_y = el.getBoundingClientRect().top; + if (el_y < 0) { + window.scrollTo(window.scrollX, window.scrollY + el_y); + } + } + }, [ m("img.avatar", {src: account.avatar_static}), m("span.acct__username", account.display_name || account.acct), // TODO figure out where to show acct m("span.acct__counts.fg2", `${own_posts}o | ${replies}r | ${reblogs}b`), @@ -299,7 +309,6 @@ m.route(document.body, "/home", { if (!localStorage.instance || !localStorage.access_token) { m.route.set("/login"); - // TODO } else { m.route.set("/home"); let masto = new Mastodon(localStorage.instance, localStorage.access_token); |