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
iv
gitlab-ce
Commits
2f4bdefc
Commit
2f4bdefc
authored
Mar 11, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to pass non-asynchronous data to GitLabDropdown
parent
8048d611
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+18
-9
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
2f4bdefc
...
...
@@ -83,15 +83,19 @@ class GitLabDropdown
search_fields
=
if
@
options
.
search
then
@
options
.
search
.
fields
else
[];
if
@
options
.
data
# Remote data
@
remote
=
new
GitLabDropdownRemote
@
options
.
data
,
{
dataType
:
@
options
.
dataType
,
beforeSend
:
@
toggleLoading
.
bind
(
@
)
success
:
(
data
)
=>
@
fullData
=
data
# If data is an array
if
_
.
isArray
@
options
.
data
@
parseData
@
options
.
data
else
# Remote data
@
remote
=
new
GitLabDropdownRemote
@
options
.
data
,
{
dataType
:
@
options
.
dataType
,
beforeSend
:
@
toggleLoading
.
bind
(
@
)
success
:
(
data
)
=>
@
fullData
=
data
@
parseData
@
fullData
}
@
parseData
@
fullData
}
# Init filiterable
if
@
options
.
filterable
...
...
@@ -204,7 +208,12 @@ class GitLabDropdown
else
selected
=
if
@
options
.
isSelected
then
@
options
.
isSelected
(
data
)
else
false
url
=
if
@
options
.
url
then
@
options
.
url
(
data
)
else
"#"
text
=
if
@
options
.
text
then
@
options
.
text
(
data
)
else
""
if
@
options
.
text
?
text
=
@
options
.
text
(
data
)
else
text
=
data
.
text
if
data
.
text
?
cssClass
=
""
;
if
selected
...
...
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