summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-08-23 01:16:57 +0300
committerFatih Acet <acetfatih@gmail.com>2017-08-23 01:19:28 +0300
commit46ed6cd8ca1a7292b62510d0c4aa13a91b4d4b2c (patch)
tree9f935d60dea38de324dfd584c796478a6c2480c1 /app/assets/javascripts
parent0d08ba3dce8513e46f5be41b369b6aa4a12df31e (diff)
downloadgitlab-ce-46ed6cd8ca1a7292b62510d0c4aa13a91b4d4b2c.tar.gz
IssueNotesRefactor: Fix eslint errors.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js2
-rw-r--r--app/assets/javascripts/notes/components/issue_note.vue11
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/field.vue20
3 files changed, 16 insertions, 17 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index c2b56ee5904..dce5e76ecee 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -32,7 +32,7 @@
const action = gl.utils.getPagePath(2);
return page === 'issues' && action === 'show';
- }
+ };
w.gl.utils.ajaxGet = function(url) {
return $.ajax({
diff --git a/app/assets/javascripts/notes/components/issue_note.vue b/app/assets/javascripts/notes/components/issue_note.vue
index 2ed803fab96..659043d9fa1 100644
--- a/app/assets/javascripts/notes/components/issue_note.vue
+++ b/app/assets/javascripts/notes/components/issue_note.vue
@@ -86,16 +86,17 @@
this.updateNote(data)
.then(() => {
this.isEditing = false;
- // TODO: this could be moved down, by setting a prop
$(this.$refs.noteBody.$el).renderGFM();
this.$refs.noteBody.resetAutoSave();
+ callback();
})
- .catch(() => Flash(
+ .catch(() => {
+ Flash(
'Something went wrong while editing your comment. Please try again.',
'alert',
- $(parentElement),
- ))
- .then(callback);
+ $(parentElement));
+ callback();
+ });
},
formCancelHandler(shouldConfirm, isDirty) {
if (shouldConfirm && isDirty) {
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 = {}) {