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
be521d7d
Commit
be521d7d
authored
Apr 15, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icons on search bar
parent
8e4aa6e3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
6 deletions
+65
-6
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+1
-1
app/assets/javascripts/search.js.coffee
app/assets/javascripts/search.js.coffee
+25
-1
app/assets/stylesheets/pages/search.scss
app/assets/stylesheets/pages/search.scss
+30
-0
app/views/search/_filter.html.haml
app/views/search/_filter.html.haml
+2
-2
app/views/search/_form.html.haml
app/views/search/_form.html.haml
+7
-2
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
be521d7d
...
...
@@ -109,7 +109,7 @@ class Dispatcher
when
'projects:group_links:index'
new
GroupsSelect
()
when
'search:show'
new
Search
Dropdowns
()
new
Search
()
switch
path
.
first
()
when
'admin'
...
...
app/assets/javascripts/search
_dropdowns
.js.coffee
→
app/assets/javascripts/search.js.coffee
View file @
be521d7d
class
@
Search
Dropdowns
class
@
Search
constructor
:
->
@
eventListeners
()
$
(
'.js-search-group-dropdown'
).
glDropdown
(
selectable
:
true
filterable
:
true
...
...
@@ -40,5 +42,27 @@ class @SearchDropdowns
@
submitSearch
()
)
eventListeners
:
->
$
(
document
)
.
off
'keyup'
,
'.js-search-input'
.
on
'keyup'
,
'.js-search-input'
,
@
searchKeyUp
$
(
document
)
.
off
'click'
,
'.js-search-clear'
.
on
'click'
,
'.js-search-clear'
,
@
clearSearchField
submitSearch
:
->
$
(
'.js-search-form'
).
submit
()
searchKeyUp
:
->
$input
=
$
(
@
)
if
$input
.
val
()
is
''
$
(
'.js-search-clear'
).
addClass
'hidden'
else
$
(
'.js-search-clear'
).
removeClass
'hidden'
clearSearchField
:
->
$
(
'.js-search-input'
)
.
val
''
.
trigger
'keyup'
app/assets/stylesheets/pages/search.scss
View file @
be521d7d
...
...
@@ -169,6 +169,19 @@
}
}
.search-icon
{
position
:
absolute
;
left
:
10px
;
top
:
10px
;
color
:
$gray-darkest
;
pointer-events
:
none
;
}
.search-text-input
{
padding-left
:
$gl-padding
+
15px
;
padding-right
:
$gl-padding
+
15px
;
}
.btn-search
{
width
:
100%
;
margin-top
:
5px
;
...
...
@@ -197,3 +210,20 @@
}
}
}
.search-clear
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;
padding
:
0
;
color
:
$gray-darkest
;
line-height
:
0
;
background
:
none
;
border
:
0
;
&
:hover
,
&
:focus
{
color
:
$gl-link-color
;
outline
:
none
;
}
}
app/views/search/_filter.html.haml
View file @
be521d7d
...
...
@@ -9,7 +9,7 @@
=
@group
.
name
-
else
Any
%b
.caret
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-title
%span
Filter results by group
...
...
@@ -26,7 +26,7 @@
=
@project
.
name_with_namespace
-
else
Any
%b
.caret
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-title
%span
Filter results by project
...
...
app/views/search/_form.html.haml
View file @
be521d7d
...
...
@@ -4,7 +4,12 @@
.search-holder
.search-field-holder
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"Search for projects, issues etc"
,
class:
"form-control search-text-input"
,
id:
"dashboard_search"
,
autofocus:
true
,
spellcheck:
false
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"Search for projects, issues etc"
,
class:
"form-control search-text-input js-search-input"
,
id:
"dashboard_search"
,
autofocus:
true
,
spellcheck:
false
=
icon
(
"search"
,
class:
"search-icon"
)
%button
.search-clear.js-search-clear
{
class:
(
"hidden"
if
!
params
[
:search
].
present?
),
type:
"button"
,
tabindex:
"-1"
}
=
icon
(
"times-circle"
)
%span
.sr-only
Clear search
-
unless
params
[
:snippets
].
eql?
'true'
=
render
'filter'
if
current_user
=
button_tag
'Search'
,
class:
"btn btn-success btn-search"
=
button_tag
"Search"
,
class:
"btn btn-success btn-search"
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