Skip to content

Commit

Permalink
Fix toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
dark-flames committed Jul 1, 2018
1 parent c927cc4 commit c7f0e13
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/MarkdownPalettes.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="mp-luogu-markdown-editor" class="mp-editor-container" :class="{'mp-full-screen': this.config.fullScreen}">
<div id="mp-luogu-markdown-editor" class="mp-editor-container" :class="{'mp-full-screen': this.fullScreen}">
<div id="mp-editor-toolbar" class="mp-editor-toolbar">
<toolbar @change="insert" @click="clickToolbar" @input="handleToolbarOperation"
:toolbarConfig="editorConfig.toolbarConfig" ref="toolbar"></toolbar>
Expand Down Expand Up @@ -112,6 +112,7 @@ export default {
insertCode: null,
editorConfig: config,
editorHeight: '500px',
fullScreen: config.fullScreen,
contentParser: contentParserFactory(config.parsers)
}
},
Expand Down Expand Up @@ -146,6 +147,18 @@ export default {
}
this.dialogRequest = request
this.showDialog = true
},
handleToolbarOperation (operation) {
if (operation === 'hide') {
if (this.config.previewDisplay === 'normal') { this.config.previewDisplay = 'hide' } else { this.config.previewDisplay = 'normal' }
}
if (operation === 'fullScreen') {
if (!this.fullScreen) {
this.fullScreen = true
} else {
this.fullScreen = false
}
}
}
},
watch: {
Expand Down

0 comments on commit c7f0e13

Please sign in to comment.