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
Léo-Paul Géneau
gitlab-ce
Commits
1445bfa1
Commit
1445bfa1
authored
Mar 25, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use hidden inputs instead of `data-selected`
parent
1cc6d786
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+6
-9
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/assets/javascripts/labels_select.js.coffee
View file @
1445bfa1
...
...
@@ -191,19 +191,16 @@ class @LabelsSelect
callback
data
renderRow
:
(
label
)
->
if
$
.
isArray
(
selectedLabel
)
selected
=
''
$
.
each
selectedLabel
,
(
i
,
selectedLbl
)
->
selectedLbl
=
selectedLbl
.
trim
()
if
selected
is
''
and
label
.
title
is
selectedLbl
selected
=
'is-active'
else
selected
=
if
label
.
title
is
selectedLabel
then
'is-active'
else
''
selectedClass
=
''
if
$selectbox
.
find
(
"input[type='hidden']
\
[name='
#{
$dropdown
.
data
(
'field-name'
)
}
']
\
[value='
#{
label
.
id
}
']"
).
length
selectedClass
=
'is-active'
color
=
if
label
.
color
?
then
"<span class='dropdown-label-box' style='background-color:
#{
label
.
color
}
'></span>"
else
""
"<li>
<a href='#' class='
#{
selected
}
'>
<a href='#' class='
#{
selected
Class
}
'>
#{
color
}
#{
label
.
title
}
</a>
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
1445bfa1
...
...
@@ -94,7 +94,7 @@
-
issuable
.
labels
.
each
do
|
label
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
selected:
issuable
.
label_names
.
join
(
","
),
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_json_path
(
issuable
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_json_path
(
issuable
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%span
.dropdown-toggle-text
Label
=
icon
(
'chevron-down'
)
...
...
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