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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
824fecb7
Commit
824fecb7
authored
Mar 31, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring back search context when chosing the same project/group
parent
ab42560e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
app/assets/javascripts/search_autocomplete.js.coffee
app/assets/javascripts/search_autocomplete.js.coffee
+23
-2
No files found.
app/assets/javascripts/search_autocomplete.js.coffee
View file @
824fecb7
...
...
@@ -104,6 +104,8 @@ class @SearchAutocomplete
lastCategory
=
suggestion
.
category
data
.
push
id
:
"
#{
suggestion
.
category
.
toLowerCase
()
}
-
#{
suggestion
.
id
}
"
category
:
suggestion
.
category
text
:
suggestion
.
label
url
:
suggestion
.
url
...
...
@@ -271,8 +273,27 @@ class @SearchAutocomplete
</ul>"
@
dropdownContent
.
html
(
html
)
onClick
:
(
item
,
e
)
->
onClick
:
(
item
,
$el
,
e
)
->
if
location
.
pathname
.
indexOf
(
item
.
url
)
isnt
-
1
e
.
preventDefault
()
if
not
@
badgePresent
if
item
.
category
is
'Projects'
@
projectInputEl
.
val
(
item
.
id
)
@
addLocationBadge
(
value
:
'This project'
)
if
item
.
category
is
'Groups'
@
groupInputEl
.
val
(
item
.
id
)
@
addLocationBadge
(
value
:
'This group'
)
$el
.
removeClass
(
'is-active'
)
@
disableAutocomplete
()
@
searchInput
.
val
(
''
)
@
searchInput
.
val
(
''
).
focus
()
# We need to wait because of @skipBlurEvent
setTimeout
(
=>
@
onSearchInputFocus
()
,
200
)
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