logs-content: Added character highlighter feature.

This commit is contained in:
2019-04-19 16:15:07 +02:00
parent 25d4aa73d1
commit f81f05d274
8 changed files with 62 additions and 10 deletions
@@ -9,6 +9,7 @@ module.exports = class {
log: input.log,
modal: null,
removed: false,
highlights: [],
}
}
@@ -161,6 +162,10 @@ module.exports = class {
this.state.removed = true
}
highlightsChanged(highlights) {
this.state.highlights = highlights.slice();
}
get title() {
if (this.state.log.title) {
return this.state.log.title
@@ -1,4 +1,4 @@
<logs-content-menu user=input.user log=state.log on-select("open") />
<logs-content-menu on-hightlights("highlightsChanged") user=input.user log=state.log on-select("open") />
<main>
<div class="logs-content">
<div class="header">
@@ -25,6 +25,7 @@
prev=(state.log.posts[loop.getIndex() - 1] || {})
post=post
characters=state.log.characters
highlights=state.highlights
last=(post.position === state.log.posts.length)
/>
</div>