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
3a8c4ebb
Commit
3a8c4ebb
authored
Mar 21, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loop through form inputs
parent
f7a97291
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
app/assets/javascripts/search_autocomplete.js.coffee
app/assets/javascripts/search_autocomplete.js.coffee
+8
-11
No files found.
app/assets/javascripts/search_autocomplete.js.coffee
View file @
3a8c4ebb
...
@@ -28,7 +28,6 @@ class @SearchAutocomplete
...
@@ -28,7 +28,6 @@ class @SearchAutocomplete
@
groupInputEl
=
@
getElement
(
'#group_id'
)
@
groupInputEl
=
@
getElement
(
'#group_id'
)
@
searchCodeInputEl
=
@
getElement
(
'#search_code'
)
@
searchCodeInputEl
=
@
getElement
(
'#search_code'
)
@
repositoryInputEl
=
@
getElement
(
'#repository_ref'
)
@
repositoryInputEl
=
@
getElement
(
'#repository_ref'
)
@
scopeInputEl
=
@
getElement
(
'#scope'
)
@
saveOriginalState
()
@
saveOriginalState
()
...
@@ -51,6 +50,7 @@ class @SearchAutocomplete
...
@@ -51,6 +50,7 @@ class @SearchAutocomplete
group_id
:
@
groupInputEl
.
val
()
group_id
:
@
groupInputEl
.
val
()
search_code
:
@
searchCodeInputEl
.
val
()
search_code
:
@
searchCodeInputEl
.
val
()
repository_ref
:
@
repositoryInputEl
.
val
()
repository_ref
:
@
repositoryInputEl
.
val
()
scope
:
@
scopeInputEl
.
val
()
# Location badge
# Location badge
_location
:
$
.
trim
(
@
locationText
.
text
())
_location
:
$
.
trim
(
@
locationText
.
text
())
...
@@ -191,20 +191,17 @@ class @SearchAutocomplete
...
@@ -191,20 +191,17 @@ class @SearchAutocomplete
@
locationBadgeEl
.
children
().
length
@
locationBadgeEl
.
children
().
length
resetSearchState
:
->
resetSearchState
:
->
# Remove scope
inputs
=
Object
.
keys
@
originalState
@
scopeInputEl
.
val
(
''
)
# Remove group
for
input
in
inputs
@
groupInputEl
.
val
(
''
)
# Remove project id
# _location isnt a input
@
projectInputEl
.
val
(
''
)
break
if
input
is
'_location'
# Remove code search
# renamed to avoid tests to fail
@
searchCodeInputEl
.
val
(
''
)
if
input
is
'project_id'
then
input
=
'search_project_id'
# Remove repository ref
@
getElement
(
"#
#{
input
}
"
).
val
(
''
)
@
repositoryInputEl
.
val
(
''
)
removeLocationBadge
:
->
removeLocationBadge
:
->
@
locationBadgeEl
.
empty
()
@
locationBadgeEl
.
empty
()
...
...
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