Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
cdb768d9
Commit
cdb768d9
authored
Jan 29, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted gl_dropdown to axios
parent
33517d54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
19 deletions
+12
-19
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+12
-19
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
cdb768d9
...
...
@@ -2,6 +2,7 @@
/* global fuzzaldrinPlus */
import
_
from
'
underscore
'
;
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
visitUrl
}
from
'
./lib/utils/url_utility
'
;
import
{
isObject
}
from
'
./lib/utils/type_utility
'
;
...
...
@@ -212,25 +213,17 @@ GitLabDropdownRemote = (function() {
};
GitLabDropdownRemote
.
prototype
.
fetchData
=
function
()
{
return
$
.
ajax
({
url
:
this
.
dataEndpoint
,
dataType
:
this
.
options
.
dataType
,
beforeSend
:
(
function
(
_this
)
{
return
function
()
{
if
(
_this
.
options
.
beforeSend
)
{
return
_this
.
options
.
beforeSend
();
}
};
})(
this
),
success
:
(
function
(
_this
)
{
return
function
(
data
)
{
if
(
_this
.
options
.
success
)
{
return
_this
.
options
.
success
(
data
);
}
};
})(
this
)
});
// Fetch the data through ajax if the data is a string
if
(
this
.
options
.
beforeSend
)
{
this
.
options
.
beforeSend
();
}
// Fetch the data through ajax if the data is a string
return
axios
.
get
(
this
.
dataEndpoint
)
.
then
(({
data
})
=>
{
if
(
this
.
options
.
success
)
{
return
this
.
options
.
success
(
data
);
}
});
};
return
GitLabDropdownRemote
;
...
...
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