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
aa316cbf
Commit
aa316cbf
authored
Apr 15, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes dropdown toggle on search dropdowns
parent
1c8d01b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
app/assets/javascripts/search.js.coffee
app/assets/javascripts/search.js.coffee
+8
-2
app/views/search/_filter.html.haml
app/views/search/_filter.html.haml
+14
-12
No files found.
app/assets/javascripts/search.js.coffee
View file @
aa316cbf
class
@
Search
class
@
Search
constructor
:
->
constructor
:
->
$groupDropdown
=
$
(
'.js-search-group-dropdown'
)
$projectDropdown
=
$
(
'.js-search-project-dropdown'
)
@
eventListeners
()
@
eventListeners
()
$
(
'.js-search-group-dropdown'
)
.
glDropdown
(
$
groupDropdown
.
glDropdown
(
selectable
:
true
selectable
:
true
filterable
:
true
filterable
:
true
fieldName
:
'group_id'
fieldName
:
'group_id'
...
@@ -18,11 +20,13 @@ class @Search
...
@@ -18,11 +20,13 @@ class @Search
obj
.
id
obj
.
id
text
:
(
obj
)
->
text
:
(
obj
)
->
obj
.
name
obj
.
name
toggleLabel
:
(
obj
)
->
"
#{
$groupDropdown
.
data
(
'default-label'
)
}
#{
obj
.
name
}
"
clicked
:
=>
clicked
:
=>
@
submitSearch
()
@
submitSearch
()
)
)
$
(
'.js-search-project-dropdown'
)
.
glDropdown
(
$
projectDropdown
.
glDropdown
(
selectable
:
true
selectable
:
true
filterable
:
true
filterable
:
true
fieldName
:
'project_id'
fieldName
:
'project_id'
...
@@ -38,6 +42,8 @@ class @Search
...
@@ -38,6 +42,8 @@ class @Search
obj
.
id
obj
.
id
text
:
(
obj
)
->
text
:
(
obj
)
->
obj
.
name_with_namespace
obj
.
name_with_namespace
toggleLabel
:
(
obj
)
->
"
#{
$projectDropdown
.
data
(
'default-label'
)
}
#{
obj
.
name_with_namespace
}
"
clicked
:
=>
clicked
:
=>
@
submitSearch
()
@
submitSearch
()
)
)
...
...
app/views/search/_filter.html.haml
View file @
aa316cbf
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
-
if
params
[
:project_id
].
present?
-
if
params
[
:project_id
].
present?
=
hidden_field_tag
:project_id
,
params
[
:project_id
]
=
hidden_field_tag
:project_id
,
params
[
:project_id
]
.dropdown
.dropdown
%button
.dropdown-menu-toggle.btn.js-search-group-dropdown
{
type:
"button"
,
data:
{
toggle:
"dropdown"
}
}
%button
.dropdown-menu-toggle.btn.js-search-group-dropdown
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
default_label:
"Group:"
}
}
Group:
%span
.dropdown-toggle-text
-
if
@group
.
present?
Group:
=
@group
.
name
-
if
@group
.
present?
-
else
=
@group
.
name
Any
-
else
Any
=
icon
(
"chevron-down"
)
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-title
.dropdown-title
...
@@ -20,12 +21,13 @@
...
@@ -20,12 +21,13 @@
=
dropdown_loading
=
dropdown_loading
.dropdown.project-filter
.dropdown.project-filter
%button
.dropdown-menu-toggle.btn.js-search-project-dropdown
{
type:
"button"
,
data:
{
toggle:
"dropdown"
}
}
%button
.dropdown-menu-toggle.btn.js-search-project-dropdown
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
default_label:
"Project:"
}
}
Project:
%span
.dropdown-toggle-text
-
if
@project
.
present?
Project:
=
@project
.
name_with_namespace
-
if
@project
.
present?
-
else
=
@project
.
name_with_namespace
Any
-
else
Any
=
icon
(
"chevron-down"
)
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-align-right
.dropdown-title
.dropdown-title
...
...
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