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
Boxiang Sun
gitlab-ce
Commits
797f29d1
Commit
797f29d1
authored
Jan 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted compare_autocomplete to axios
parent
9846332f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
app/assets/javascripts/compare_autocomplete.js
app/assets/javascripts/compare_autocomplete.js
+8
-7
No files found.
app/assets/javascripts/compare_autocomplete.js
View file @
797f29d1
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, one-var-declaration-per-line, object-shorthand, comma-dangle, prefer-arrow-callback, no-else-return, newline-per-chained-call, wrap-iife, max-len */
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, one-var-declaration-per-line, object-shorthand, comma-dangle, prefer-arrow-callback, no-else-return, newline-per-chained-call, wrap-iife, max-len */
import
axios
from
'
./lib/utils/axios_utils
'
;
import
flash
from
'
./flash
'
;
export
default
function
initCompareAutocomplete
()
{
export
default
function
initCompareAutocomplete
()
{
$
(
'
.js-compare-dropdown
'
).
each
(
function
()
{
$
(
'
.js-compare-dropdown
'
).
each
(
function
()
{
...
@@ -10,15 +12,14 @@ export default function initCompareAutocomplete() {
...
@@ -10,15 +12,14 @@ export default function initCompareAutocomplete() {
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
$dropdown
.
glDropdown
({
$dropdown
.
glDropdown
({
data
:
function
(
term
,
callback
)
{
data
:
function
(
term
,
callback
)
{
return
$
.
ajax
({
axios
.
get
(
$dropdown
.
data
(
'
refsUrl
'
),
{
url
:
$dropdown
.
data
(
'
refs-url
'
),
params
:
{
data
:
{
ref
:
$dropdown
.
data
(
'
ref
'
),
ref
:
$dropdown
.
data
(
'
ref
'
),
search
:
term
,
search
:
term
,
}
}
,
}).
done
(
function
(
refs
)
{
}).
then
(({
data
})
=>
{
return
callback
(
refs
);
callback
(
data
);
});
})
.
catch
(()
=>
flash
(
'
Error fetching refs
'
))
;
},
},
selectable
:
true
,
selectable
:
true
,
filterable
:
true
,
filterable
:
true
,
...
...
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