diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-11-01 18:43:25 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-11-01 18:43:25 +0300 |
commit | a1c390653cf651378aadfc74d60833628ec2c47c (patch) | |
tree | 345c6ea065883e3dbdc4d0cf0cb03c89fb9b2e6a /app/assets/javascripts/vue_shared | |
parent | 518f277bb97217c91dc0d3a9379badd80fd4bc69 (diff) |
Fix markdown-preview events for new isPreview var
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-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> |