|
@ -16,6 +16,7 @@ module.exports = class { |
|
|
|
|
|
|
|
|
addChapter(chapter) { |
|
|
addChapter(chapter) { |
|
|
this.state.story.chapters.push(chapter) |
|
|
this.state.story.chapters.push(chapter) |
|
|
|
|
|
this.refreshStory() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
updateChapter(id, data) { |
|
|
updateChapter(id, data) { |
|
@ -31,6 +32,8 @@ module.exports = class { |
|
|
|
|
|
|
|
|
this.state.story.chapters[index][key] = data[key] |
|
|
this.state.story.chapters[index][key] = data[key] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.refreshStory() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
removeChapter(id) { |
|
|
removeChapter(id) { |
|
@ -40,6 +43,8 @@ module.exports = class { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.state.story.chapters.splice(index, 1) |
|
|
this.state.story.chapters.splice(index, 1) |
|
|
|
|
|
|
|
|
|
|
|
this.refreshStory() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
menuSelect(kind, id) { |
|
|
menuSelect(kind, id) { |
|
@ -51,4 +56,8 @@ module.exports = class { |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
refreshStory() { |
|
|
|
|
|
this.state.story = Object.assign({}, this.state.story) |
|
|
|
|
|
} |
|
|
} |
|
|
} |