Commit 46ed6cd8 authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Fix eslint errors.

parent 0d08ba3d
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
const action = gl.utils.getPagePath(2); const action = gl.utils.getPagePath(2);
return page === 'issues' && action === 'show'; return page === 'issues' && action === 'show';
} };
w.gl.utils.ajaxGet = function(url) { w.gl.utils.ajaxGet = function(url) {
return $.ajax({ return $.ajax({
......
...@@ -86,16 +86,17 @@ ...@@ -86,16 +86,17 @@
this.updateNote(data) this.updateNote(data)
.then(() => { .then(() => {
this.isEditing = false; this.isEditing = false;
// TODO: this could be moved down, by setting a prop
$(this.$refs.noteBody.$el).renderGFM(); $(this.$refs.noteBody.$el).renderGFM();
this.$refs.noteBody.resetAutoSave(); this.$refs.noteBody.resetAutoSave();
callback();
}) })
.catch(() => Flash( .catch(() => {
Flash(
'Something went wrong while editing your comment. Please try again.', 'Something went wrong while editing your comment. Please try again.',
'alert', 'alert',
$(parentElement), $(parentElement));
)) callback();
.then(callback); });
}, },
formCancelHandler(shouldConfirm, isDirty) { formCancelHandler(shouldConfirm, isDirty) {
if (shouldConfirm && isDirty) { if (shouldConfirm && isDirty) {
......
...@@ -55,18 +55,16 @@ ...@@ -55,18 +55,16 @@
if (!this.previewMarkdown) { if (!this.previewMarkdown) {
this.markdownPreview = ''; 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 { } else {
if (text) { this.renderMarkdown();
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();
}
} }
}, },
renderMarkdown(data = {}) { renderMarkdown(data = {}) {
......
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