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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c6526f45
Commit
c6526f45
authored
Nov 14, 2019
by
Utkarsh Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remote var from compare_autocomplete.js
parent
5aace8a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
app/assets/javascripts/compare_autocomplete.js
app/assets/javascripts/compare_autocomplete.js
+8
-10
No files found.
app/assets/javascripts/compare_autocomplete.js
View file @
c6526f45
/* eslint-disable func-names,
one-var, no-var,
no-else-return */
/* eslint-disable func-names, no-else-return */
import
$
from
'
jquery
'
;
import
{
__
}
from
'
./locale
'
;
...
...
@@ -8,9 +8,8 @@ import { capitalizeFirstCharacter } from './lib/utils/text_utility';
export
default
function
initCompareAutocomplete
(
limitTo
=
null
,
clickHandler
=
()
=>
{})
{
$
(
'
.js-compare-dropdown
'
).
each
(
function
()
{
var
$dropdown
,
selected
;
$dropdown
=
$
(
this
);
selected
=
$dropdown
.
data
(
'
selected
'
);
const
$dropdown
=
$
(
this
);
const
selected
=
$dropdown
.
data
(
'
selected
'
);
const
$dropdownContainer
=
$dropdown
.
closest
(
'
.dropdown
'
);
const
$fieldInput
=
$
(
`input[name="
${
$dropdown
.
data
(
'
fieldName
'
)}
"]`
,
$dropdownContainer
);
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
...
...
@@ -44,17 +43,16 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = (
fieldName
:
$dropdown
.
data
(
'
fieldName
'
),
filterInput
:
'
input[type="search"]
'
,
renderRow
(
ref
)
{
var
link
;
const
link
=
$
(
'
<a />
'
)
.
attr
(
'
href
'
,
'
#
'
)
.
addClass
(
ref
===
selected
?
'
is-active
'
:
''
)
.
text
(
ref
)
.
attr
(
'
data-ref
'
,
ref
);
if
(
ref
.
header
!=
null
)
{
return
$
(
'
<li />
'
)
.
addClass
(
'
dropdown-header
'
)
.
text
(
ref
.
header
);
}
else
{
link
=
$
(
'
<a />
'
)
.
attr
(
'
href
'
,
'
#
'
)
.
addClass
(
ref
===
selected
?
'
is-active
'
:
''
)
.
text
(
ref
)
.
attr
(
'
data-ref
'
,
ref
);
return
$
(
'
<li />
'
).
append
(
link
);
}
},
...
...
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