BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
11df0c23
Commit
11df0c23
authored
Feb 05, 2018
by
Clement Ho
Committed by
Fatih Acet
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $.ajax in preview markdown with axios
parent
3cb7b472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
preview_markdown.js
app/assets/javascripts/preview_markdown.js
+15
-15
No files found.
app/assets/javascripts/preview_markdown.js
View file @
11df0c23
...
...
@@ -7,6 +7,10 @@
// more than `x` users are referenced.
//
import
axios
from
'~/lib/utils/axios_utils'
;
import
flash
from
'~/flash'
;
import
{
__
}
from
'~/locale'
;
var
lastTextareaPreviewed
;
var
lastTextareaHeight
=
null
;
var
markdownPreview
;
...
...
@@ -62,21 +66,17 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function (text, url, success) {
success
(
this
.
ajaxCache
.
response
);
return
;
}
$
.
ajax
({
type
:
'POST'
,
url
:
url
,
data
:
{
text
:
text
},
dataType
:
'json'
,
success
:
(
function
(
response
)
{
this
.
ajaxCache
=
{
text
:
text
,
response
:
response
};
success
(
response
);
}).
bind
(
this
)
});
axios
.
post
(
url
,
{
text
,
})
.
then
(({
data
})
=>
{
this
.
ajaxCache
=
{
text
:
text
,
response
:
data
,
};
success
(
data
);
})
.
catch
(()
=>
flash
(
__
(
'An error occurred while fetching markdown preview'
)));
};
MarkdownPreview
.
prototype
.
hideReferencedUsers
=
function
(
$form
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment