Skip to content
Snippets Groups Projects
Commit 2f4bdefc authored by Alfredo Sumaran's avatar Alfredo Sumaran
Browse files

Allow to pass non-asynchronous data to GitLabDropdown

parent 8048d611
No related branches found
No related tags found
1 merge request!3212Location aware search
Loading
Loading
@@ -83,6 +83,10 @@ class GitLabDropdown
search_fields = if @options.search then @options.search.fields else [];
 
if @options.data
# If data is an array
if _.isArray @options.data
@parseData @options.data
else
# Remote data
@remote = new GitLabDropdownRemote @options.data, {
dataType: @options.dataType,
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment