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

IssueNotesRefactor: Fix eslint errors.

parent 0d08ba3d
......@@ -32,7 +32,7 @@
const action = gl.utils.getPagePath(2);
return page === 'issues' && action === 'show';
}
};
w.gl.utils.ajaxGet = function(url) {
return $.ajax({
......
......@@ -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) {
......
......@@ -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 = {}) {
......
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