story-content: Added tag add/remove modal

This commit is contained in:
2018-09-22 15:33:10 +02:00
parent bf6fbf92e9
commit 2e8737505e
14 changed files with 278 additions and 13 deletions
@@ -48,8 +48,6 @@ module.exports = class {
}
menuSelect(kind, id) {
console.log(kind, id)
switch (kind) {
case "add":
this.open("chapter.add")
@@ -57,6 +55,11 @@ module.exports = class {
}
}
updateStoryTags(tags) {
this.state.story.tags = tags
this.refreshStory()
}
refreshStory() {
this.state.story = Object.assign({}, this.state.story)
}
@@ -2,10 +2,10 @@
<main>
<div class="story-content">
<h1 class="color-primary">${state.story.name}</h1>
<story-tags tags=state.story.tags />
<story-tags tags=state.story.tags on-select("open", "story.tags")/>
<chapter for(chapter in state.story.chapters) key=chapter.id chapter=chapter on-edit("updateChapter", chapter.id) on-remove("removeChapter", chapter.id)/>
</div>
<create-chapter-modal storyId=state.story.id enabled=(state.modal === "chapter.add") chapter=input.chapter on-close("close") on-add("addChapter") />
<edit-story-tags-modal enabled=(state.modal === "story.tags") story=state.story on-tags("updateStoryTags") on-close("close") />
</main>