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
Tatuya Kamada
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
Show 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
...
@@ -191,19 +191,16 @@ class @LabelsSelect
callback
data
callback
data
renderRow
:
(
label
)
->
renderRow
:
(
label
)
->
if
$
.
isArray
(
selectedLabel
)
selectedClass
=
''
selected
=
''
if
$selectbox
.
find
(
"input[type='hidden']
\
$
.
each
selectedLabel
,
(
i
,
selectedLbl
)
->
[name='
#{
$dropdown
.
data
(
'field-name'
)
}
']
\
selectedLbl
=
selectedLbl
.
trim
()
[value='
#{
label
.
id
}
']"
).
length
if
selected
is
''
and
label
.
title
is
selectedLbl
selectedClass
=
'is-active'
selected
=
'is-active'
else
selected
=
if
label
.
title
is
selectedLabel
then
'is-active'
else
''
color
=
if
label
.
color
?
then
"<span class='dropdown-label-box' style='background-color:
#{
label
.
color
}
'></span>"
else
""
color
=
if
label
.
color
?
then
"<span class='dropdown-label-box' style='background-color:
#{
label
.
color
}
'></span>"
else
""
"<li>
"<li>
<a href='#' class='
#{
selected
}
'>
<a href='#' class='
#{
selected
Class
}
'>
#{
color
}
#{
color
}
#{
label
.
title
}
#{
label
.
title
}
</a>
</a>
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
1445bfa1
...
@@ -94,7 +94,7 @@
...
@@ -94,7 +94,7 @@
-
issuable
.
labels
.
each
do
|
label
|
-
issuable
.
labels
.
each
do
|
label
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
.dropdown
.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
%span
.dropdown-toggle-text
Label
Label
=
icon
(
'chevron-down'
)
=
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