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
2541f592
Commit
2541f592
authored
Mar 09, 2016
by
Alfredo Sumaran
Committed by
Jacob Schatz
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better wording
parent
ec0dfff2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/assets/javascripts/search_autocomplete.js.coffee
app/assets/javascripts/search_autocomplete.js.coffee
+4
-4
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+2
-2
No files found.
app/assets/javascripts/search_autocomplete.js.coffee
View file @
2541f592
...
@@ -84,14 +84,14 @@ class @SearchAutocomplete
...
@@ -84,14 +84,14 @@ class @SearchAutocomplete
if
event
.
keyCode
is
@
keyCode
.
ENTER
if
event
.
keyCode
is
@
keyCode
.
ENTER
@
goToResult
(
ui
.
item
)
@
goToResult
(
ui
.
item
)
else
else
# Pressing tab sets the
scope
# Pressing tab sets the
location
if
event
.
keyCode
is
@
keyCode
.
TAB
and
ui
.
item
.
scope
?
if
event
.
keyCode
is
@
keyCode
.
TAB
and
ui
.
item
.
location
?
@
setLocationBadge
(
ui
.
item
)
@
setLocationBadge
(
ui
.
item
)
@
searchInput
@
searchInput
.
val
(
''
)
# remove selected value from input
.
val
(
''
)
# remove selected value from input
.
focus
()
.
focus
()
else
else
# If option is not a
scope
go to page
# If option is not a
location
go to page
@
goToResult
(
ui
.
item
)
@
goToResult
(
ui
.
item
)
# Return false to avoid focus on the next element
# Return false to avoid focus on the next element
...
@@ -153,7 +153,7 @@ class @SearchAutocomplete
...
@@ -153,7 +153,7 @@ class @SearchAutocomplete
# Reset input states
# Reset input states
@
resetSearchState
()
@
resetSearchState
()
switch
item
.
scope
switch
item
.
location
when
'projects'
when
'projects'
@
projectInputEl
.
val
(
item
.
id
)
@
projectInputEl
.
val
(
item
.
id
)
# @searchCodeInputEl.val('true') # TODO: always true for projects?
# @searchCodeInputEl.val('true') # TODO: always true for projects?
...
...
app/helpers/search_helper.rb
View file @
2541f592
...
@@ -72,7 +72,7 @@ module SearchHelper
...
@@ -72,7 +72,7 @@ module SearchHelper
current_user
.
authorized_groups
.
search
(
term
).
limit
(
limit
).
map
do
|
group
|
current_user
.
authorized_groups
.
search
(
term
).
limit
(
limit
).
map
do
|
group
|
{
{
category:
"Groups"
,
category:
"Groups"
,
scope
:
"groups"
,
location
:
"groups"
,
id:
group
.
id
,
id:
group
.
id
,
label:
"
#{
search_result_sanitize
(
group
.
name
)
}
"
,
label:
"
#{
search_result_sanitize
(
group
.
name
)
}
"
,
url:
group_path
(
group
)
url:
group_path
(
group
)
...
@@ -86,7 +86,7 @@ module SearchHelper
...
@@ -86,7 +86,7 @@ module SearchHelper
sorted_by_stars
.
non_archived
.
limit
(
limit
).
map
do
|
p
|
sorted_by_stars
.
non_archived
.
limit
(
limit
).
map
do
|
p
|
{
{
category:
"Projects"
,
category:
"Projects"
,
scope
:
"projects"
,
location
:
"projects"
,
id:
p
.
id
,
id:
p
.
id
,
value:
"
#{
search_result_sanitize
(
p
.
name
)
}
"
,
value:
"
#{
search_result_sanitize
(
p
.
name
)
}
"
,
label:
"
#{
search_result_sanitize
(
p
.
name_with_namespace
)
}
"
,
label:
"
#{
search_result_sanitize
(
p
.
name_with_namespace
)
}
"
,
...
...
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