gotta try this on live.

This commit is contained in:
Jason Schwarzenberger
2020-12-02 13:22:47 +13:00
parent 32f1455bbb
commit 59c6f17e67
6 changed files with 17 additions and 13 deletions

View File

@@ -54,10 +54,6 @@
overflow: hidden;
color: #888;
}
.comment-text.is-collapsed::after {
content: "...";
font-style: italic;
}
.comment-children {
margin-left: 0.5rem;
padding-left: 0.5rem;
@@ -85,14 +81,15 @@
<header class="comment-info">
<span
class={comment.author === story.author ? 'comment-author is-op' : 'comment-author'}>{comment.author || '[Deleted]'}</span>
&bull;
<a class="time-link" href="{story.id}#comment-{id}">
<Time date={comment.date} />
</a>
{#if comment.comments.length}
<button
class="toggle-children"
on:click={toggleComments}>[{showComments ? '-' : '+'}]</button>
on:click={toggleComments}>{#if showComments}
[&ndash;]
{:else}[+]{/if}</button>
{/if}
</header>

View File

@@ -11,7 +11,7 @@
on
<a class="source" href={story.link || story.url}>{story.source}</a>
{#if story.score}&bull; {story.score} points{/if}
{#if story.num_comments}
{#if Number(story.num_comments)}
&bull;
<a rel="prefetch" href="/{story.id}#comments">{story.num_comments}
comments</a>

View File

@@ -18,8 +18,10 @@
export let story;
export let related;
let others = related.filter((r) => r.id !== story.id && r.num_comments);
let hasComments = related.some((r) => r.num_comments);
let others = related.filter(
(r) => r.id !== story.id && Number(r.num_comments)
);
let hasComments = related.some((r) => Number(r.num_comments));
</script>
<style>