diff options
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/header.vue | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue index d4a3f532a09..fc26b7e170d 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/header.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue @@ -22,19 +22,26 @@ toggleMarkdownPreview(e, isPreview, form) { if (e.target.blur) e.target.blur(); - if (this.isMarkdownForm(form)) return; this.$emit('toggle-markdown', isPreview); }, + + toggleMarkdownPreviewShow(event, form) { + return this.toggleMarkdownPreview(event, true, form); + }, + + toggleMarkdownPreviewHide(event, form) { + return this.toggleMarkdownPreview(event, false, form); + }, }, mounted() { - $(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview); - $(document).on('markdown-preview:hide.vue', this.toggleMarkdownPreview); + $(document).on('markdown-preview:show.vue', this.toggleMarkdownPreviewShow); + $(document).on('markdown-preview:hide.vue', this.toggleMarkdownPreviewHide); }, beforeDestroy() { - $(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview); - $(document).off('markdown-preview:hide.vue', this.toggleMarkdownPreview); + $(document).off('markdown-preview:show.vue', this.toggleMarkdownPreviewShow); + $(document).off('markdown-preview:hide.vue', this.toggleMarkdownPreviewHide); }, }; </script> |