story-content: Added edit story modal, added toggle component.

This commit is contained in:
2018-09-23 15:12:26 +02:00
parent 564192c76d
commit a2d949edaf
13 changed files with 196 additions and 4 deletions
@@ -15,6 +15,10 @@ module.exports = class {
this.state.modal = null
}
updateStory(data) {
this.state.story = Object.assign(Object.assign({}, this.state.story), data)
}
addChapter(chapter) {
this.state.story.chapters.push(chapter)
this.refreshStory()
@@ -18,5 +18,6 @@
<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") />
<edit-story-modal enabled=(state.modal === "story.edit") story=state.story categories=input.categories on-edit("updateStory") on-close("close") />
<remove-story-modal enabled=(state.modal === "story.remove") story=state.story on-remove("timeToDie") on-close("close") />
</main>
@@ -14,7 +14,6 @@
margin-bottom: 1em;
h1 {
vertical-align: middle;
display: block;
margin-bottom: 0;
}