Skip to content

Commit 32c1600

Browse files
author
Dan Hersam
committed
Display content for job items.
I'd like a cleaner way to toggle the 'No comments yet' message, but I don't know how (or if it's possible) to access Item.isJob() from ItemView.
1 parent 4b2a6a0 commit 32c1600

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/components/Item.vue

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| <a :href="'#/item/' + item.id">{{item.descendants}} {{item.descendants | pluralize 'comment'}}</a>
1818
</span>
1919
</p>
20+
<p class="jobtext" v-show="isJob" v-html="item.text"></p>
2021
</div>
2122
</template>
2223

@@ -39,6 +40,9 @@ export default {
3940
},
4041
showDomain () {
4142
return this.item.type === 'story'
43+
},
44+
isJob () {
45+
return this.item.type === 'job'
4246
}
4347
}
4448
}
@@ -69,4 +73,9 @@ export default {
6973
color $gray
7074
.subtext a:hover
7175
text-decoration underline
76+
.jobtext
77+
color $gray
78+
padding-top 5px
79+
.jobtext p
80+
margin 10px 0
7281
</style>

src/components/ItemView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:comment="comment">
1414
</comment>
1515
</ul>
16-
<p v-show="!comments.length">No comments yet.</p>
16+
<p v-show="!comments.length && item.type !== 'job'">No comments yet.</p>
1717
</div>
1818
</template>
1919

0 commit comments

Comments
 (0)