diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-08-23 01:16:57 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-08-23 01:19:28 +0300 |
commit | 46ed6cd8ca1a7292b62510d0c4aa13a91b4d4b2c (patch) | |
tree | 9f935d60dea38de324dfd584c796478a6c2480c1 /app/assets/javascripts/vue_shared | |
parent | 0d08ba3dce8513e46f5be41b369b6aa4a12df31e (diff) |
IssueNotesRefactor: Fix eslint errors.
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/field.vue | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/field.vue b/app/assets/javascripts/vue_shared/components/markdown/field.vue index 9e93feeda3b..759d30c9c7c 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/field.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/field.vue @@ -55,18 +55,16 @@ if (!this.previewMarkdown) { this.markdownPreview = ''; + } else if (text) { + this.markdownPreviewLoading = true; + this.$http.post(this.markdownPreviewPath, { text }) + .then(resp => resp.json()) + .then((data) => { + this.renderMarkdown(data); + }) + .catch(() => new Flash('Error loading markdown preview')); } else { - if (text) { - this.markdownPreviewLoading = true; - this.$http.post(this.markdownPreviewPath, { text }) - .then(resp => resp.json()) - .then((data) => { - this.renderMarkdown(data); - }) - .catch(() => new Flash('Error loading markdown preview')); - } else { - this.renderMarkdown(); - } + this.renderMarkdown(); } }, renderMarkdown(data = {}) { |