diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-07-04 01:59:37 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-07-21 22:35:25 +0300 |
commit | 7fcc1eef9e0c082baf0c97c287ea0627678867cd (patch) | |
tree | e3524ae9dca837e43530af02c966ba58d3bb11b9 | |
parent | 0c0b5fab13582da3240dbc1526c8758033646c70 (diff) | |
download | gitlab-ce-7fcc1eef9e0c082baf0c97c287ea0627678867cd.tar.gz |
Show ”Nothing to preview” if the markdown area is empty.
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/field.vue | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/field.vue b/app/assets/javascripts/vue_shared/components/markdown/field.vue index 547e459d8e9..865cd0244d5 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/field.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/field.vue @@ -54,6 +54,10 @@ this.markdownPreviewLoading = false; this.markdownPreview = data.body; + if (!this.markdownPreview) { + this.markdownPreview = 'Nothing to preview.'; + } + this.$nextTick(() => { $(this.$refs['markdown-preview']).renderGFM(); }); |