summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-07-04 01:59:37 +0300
committerFatih Acet <acetfatih@gmail.com>2017-07-21 22:35:25 +0300
commit7fcc1eef9e0c082baf0c97c287ea0627678867cd (patch)
treee3524ae9dca837e43530af02c966ba58d3bb11b9
parent0c0b5fab13582da3240dbc1526c8758033646c70 (diff)
downloadgitlab-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.vue4
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();
});