Fixes reply box's border.

This commit is contained in:
Dominik Picheta 2018-05-12 14:16:23 +01:00
commit 6fe8286509
2 changed files with 6 additions and 4 deletions

View file

@ -174,9 +174,10 @@ when defined(js):
genPost(post, list.thread, isLoggedIn)
prevPost = some(post)
if list.moreCount > 0:
let hasMore = list.moreCount > 0
if hasMore:
genLoadMore(list.posts.len)
elif prevPost.isSome:
genTimePassed(prevPost.get(), none[Post]())
render(state.replyBox, list.thread, state.replyingTo)
render(state.replyBox, list.thread, state.replyingTo, hasMore)

View file

@ -31,12 +31,13 @@ when defined(js):
state.shown = true
proc render*(state: ReplyBox, thread: Thread, post: Option[Post]): VNode =
proc render*(state: ReplyBox, thread: Thread, post: Option[Post],
hasMore: bool): VNode =
if not state.shown:
return buildHtml(tdiv(id="reply-box"))
result = buildHtml():
tdiv(class="information no-border", id="reply-box"):
tdiv(class=class({"no-border": hasMore}, "information"), id="reply-box"):
tdiv(class="information-icon"):
italic(class="fas fa-reply")
tdiv(class="information-main", style=style(StyleAttr.width, "100%")):