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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b0639b1f
Commit
b0639b1f
authored
Mar 11, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Weight filter uses the new dropdown
parent
baee27cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
app/assets/javascripts/weight_select.js.coffee
app/assets/javascripts/weight_select.js.coffee
+12
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+10
-3
No files found.
app/assets/javascripts/weight_select.js.coffee
0 → 100644
View file @
b0639b1f
class
@
WeightSelect
constructor
:
->
$
(
'.js-weight-select'
).
each
(
i
,
dropdown
)
->
$
(
dropdown
).
glDropdown
(
selectable
:
true
fieldName
:
$
(
dropdown
).
data
(
"field-name"
)
id
:
(
obj
,
el
)
->
$
(
el
).
data
"id"
clicked
:
->
if
$
(
dropdown
).
is
".js-filter-submit"
$
(
dropdown
).
parents
(
'form'
).
submit
()
)
app/views/shared/issuable/_filter.html.haml
View file @
b0639b1f
...
...
@@ -81,9 +81,15 @@
-
if
controller
.
controller_name
==
'issues'
.filter-item.inline.weight-filter
=
select_tag
(
'weight'
,
issues_weight_options
(
edit:
false
),
class:
'select2 trigger-submit'
,
include_blank:
true
,
data:
{
placeholder:
'Weight'
})
-
if
params
[
:weight
]
=
hidden_field_tag
(
:weight
,
params
[
:weight
])
=
dropdown_tag
(
"Weight"
,
options:
{
title:
"Filter by weight"
,
toggle_class:
'js-weight-select js-filter-submit'
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search weight"
,
data:
{
field_name:
"weight"
}
})
do
%ul
-
Issue
.
weight_options
.
each
do
|
weight
|
%li
%a
{
href:
"#"
,
data:
{
id:
weight
},
class:
(
"is-active"
if
params
[
:weight
]
==
weight
.
to_s
)}
=
weight
.pull-right
=
render
'shared/sort_dropdown'
...
...
@@ -118,6 +124,7 @@
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
new
WeightSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
Turbolinks
.
visit
(
this
.
action
+
'
&
'
+
$
(
this
).
serialize
());
...
...
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