Commit a1c39065 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Fix markdown-preview events for new isPreview var

parent 518f277b
...@@ -22,19 +22,26 @@ ...@@ -22,19 +22,26 @@
toggleMarkdownPreview(e, isPreview, form) { toggleMarkdownPreview(e, isPreview, form) {
if (e.target.blur) e.target.blur(); if (e.target.blur) e.target.blur();
if (this.isMarkdownForm(form)) return; if (this.isMarkdownForm(form)) return;
this.$emit('toggle-markdown', isPreview); this.$emit('toggle-markdown', isPreview);
}, },
toggleMarkdownPreviewShow(event, form) {
return this.toggleMarkdownPreview(event, true, form);
},
toggleMarkdownPreviewHide(event, form) {
return this.toggleMarkdownPreview(event, false, form);
},
}, },
mounted() { mounted() {
$(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview); $(document).on('markdown-preview:show.vue', this.toggleMarkdownPreviewShow);
$(document).on('markdown-preview:hide.vue', this.toggleMarkdownPreview); $(document).on('markdown-preview:hide.vue', this.toggleMarkdownPreviewHide);
}, },
beforeDestroy() { beforeDestroy() {
$(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview); $(document).off('markdown-preview:show.vue', this.toggleMarkdownPreviewShow);
$(document).off('markdown-preview:hide.vue', this.toggleMarkdownPreview); $(document).off('markdown-preview:hide.vue', this.toggleMarkdownPreviewHide);
}, },
}; };
</script> </script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment