Focus replies when "Load more" clicked
This commit is contained in:
parent
f1529077d7
commit
c25b780c03
|
@ -14,7 +14,7 @@
|
||||||
background-color: $bg_panel;
|
background-color: $bg_panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-tweet {
|
.main-tweet, .replies {
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
margin-top: -50px;
|
margin-top: -50px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,10 @@ proc renderConversation*(conversation: Conversation; prefs: Prefs; path: string)
|
||||||
renderNewer(Query(), getLink(conversation.tweet))
|
renderNewer(Query(), getLink(conversation.tweet))
|
||||||
|
|
||||||
if conversation.replies.content.len > 0:
|
if conversation.replies.content.len > 0:
|
||||||
tdiv(class="replies"):
|
tdiv(class="replies", id="r"):
|
||||||
for thread in conversation.replies.content:
|
for thread in conversation.replies.content:
|
||||||
if thread == nil: continue
|
if thread == nil: continue
|
||||||
renderReplyThread(thread, prefs, path)
|
renderReplyThread(thread, prefs, path)
|
||||||
|
|
||||||
if conversation.replies.hasMore:
|
if conversation.replies.hasMore:
|
||||||
renderMore(Query(), conversation.replies.minId)
|
renderMore(Query(), conversation.replies.minId, focus="#r")
|
||||||
|
|
|
@ -17,9 +17,9 @@ proc renderNewer*(query: Query; path: string): VNode =
|
||||||
a(href=(path & url)):
|
a(href=(path & url)):
|
||||||
text "Load newest"
|
text "Load newest"
|
||||||
|
|
||||||
proc renderMore*(query: Query; minId: string): VNode =
|
proc renderMore*(query: Query; minId: string; focus=""): VNode =
|
||||||
buildHtml(tdiv(class="show-more")):
|
buildHtml(tdiv(class="show-more")):
|
||||||
a(href=(&"?{getQuery(query)}max_position={minId}")):
|
a(href=(&"?{getQuery(query)}max_position={minId}{focus}")):
|
||||||
text "Load more"
|
text "Load more"
|
||||||
|
|
||||||
proc renderNoMore(): VNode =
|
proc renderNoMore(): VNode =
|
||||||
|
|
Loading…
Reference in New Issue