summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/app.js b/app.js
index d024a8c..636d07e 100644
--- a/app.js
+++ b/app.js
@@ -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);