|
@@ -9,6 +9,7 @@
|
|
|
<div class="full-page-takeover-header-button">
|
|
|
<!-- TODO: Check blog validity before publishing -->
|
|
|
<Modal
|
|
|
+ @submitted="publishBlog"
|
|
|
@opened="checkBlogValidity"
|
|
|
openTitle="Publish"
|
|
|
openBtnClass="button is-success is-medium is-inverted is-outlined"
|
|
@@ -81,7 +82,10 @@ export default {
|
|
|
...mapState({
|
|
|
blog: ({instructor}) => instructor.blog.item,
|
|
|
isSaving: ({instructor}) => instructor.blog.isSaving
|
|
|
- })
|
|
|
+ }),
|
|
|
+ editor() {
|
|
|
+ return this.$refs.editor
|
|
|
+ }
|
|
|
},
|
|
|
async fetch({params, store}){
|
|
|
await store.dispatch('instructor/blog/fetchBlogById', params.id)
|
|
@@ -107,8 +111,12 @@ export default {
|
|
|
this.$toasted.error('Blog cannot be saved!', {duration: 2000})
|
|
|
}
|
|
|
},
|
|
|
+ publishBlog({closeModal}) {
|
|
|
+ const blogContent = this.editor.getContent()
|
|
|
+ debugger
|
|
|
+ },
|
|
|
checkBlogValidity() {
|
|
|
- const title = this.$refs.editor.getNodeValueByName('title')
|
|
|
+ const title = this.editor.getNodeValueByName('title')
|
|
|
this.publishError = ''
|
|
|
this.slug = ''
|
|
|
if (title && title.length > 24) {
|