forked from tanner/qotnews
gotta try this on live.
This commit is contained in:
@@ -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>
|
||||
•
|
||||
<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}
|
||||
[–]
|
||||
{:else}[+]{/if}</button>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
on
|
||||
<a class="source" href={story.link || story.url}>{story.source}</a>
|
||||
{#if story.score}• {story.score} points{/if}
|
||||
{#if story.num_comments}
|
||||
{#if Number(story.num_comments)}
|
||||
•
|
||||
<a rel="prefetch" href="/{story.id}#comments">{story.num_comments}
|
||||
comments</a>
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user