BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d17b5499
Commit
d17b5499
authored
Mar 15, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make remove multi and remove single work.
Make add single and add multi work properly. Multiple inputs for multiselect
parent
c81b2613
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+1
-7
labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+5
-3
_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+2
-2
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
d17b5499
...
...
@@ -270,7 +270,6 @@ class GitLabDropdown
rowClicked
:
(
el
)
->
fieldName
=
@
options
.
fieldName
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
']"
)
selectedIndex
=
el
.
parent
().
index
()
if
@
renderedData
selectedObject
=
@
renderedData
[
selectedIndex
]
...
...
@@ -278,10 +277,6 @@ class GitLabDropdown
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
'][value='
#{
value
}
']"
)
if
el
.
hasClass
(
ACTIVE_CLASS
)
console
.
log
'has ACTIVE_CLASS'
# if @options.multiSelect
# console.log field.val(), value
# else
field
.
remove
()
else
fieldName
=
@
options
.
fieldName
...
...
@@ -296,6 +291,7 @@ class GitLabDropdown
if
not
@
options
.
multiSelect
@
dropdown
.
find
(
".
#{
ACTIVE_CLASS
}
"
).
removeClass
ACTIVE_CLASS
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
']"
).
remove
()
# Toggle active class for the tick mark
el
.
toggleClass
"is-active"
...
...
@@ -308,8 +304,6 @@ class GitLabDropdown
# Create hidden input for form
input
=
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
@
dropdown
.
before
input
else
console
.
log
'has field???'
selectFirstRow
:
->
selector
=
'.dropdown-content li:first-child a'
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
d17b5499
...
...
@@ -191,11 +191,13 @@ class @LabelsSelect
else
selected
=
$dropdown
.
closest
(
'.selectbox'
)
.
find
(
'input[type="hidden"]'
)
.
val
()
.
find
(
"input[name='
#{
$dropdown
.
data
(
'field-name'
)
}
']"
)
.
map
(
->
@
value
).
get
()
# need inline-block here instead of show,
# which will default to the element's style in this case inline.
selected
=
if
selected
?
then
selected
.
split
(
','
)
else
[
''
]
selected
=
if
selected
.
length
then
selected
else
[
''
]
$loading
.
fadeIn
()
$
.
ajax
(
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
d17b5499
...
...
@@ -87,9 +87,9 @@
.light
None
.selectbox.hide-collapsed
-
issuable
.
labels
.
each
do
|
label
|
=
f
.
hidden_field
'label_name'
,
value:
label
.
id
,
id:
nil
=
hidden_field_tag
'issue[label_names][]'
,
label
.
id
,
id:
nil
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"issue[label_name]"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
issuable
.
label_names
.
join
(
","
),
project_id:
(
@project
.
id
if
@project
),
issue_update:
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
issuable
.
id
,
:json
),
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:
"issue[label_name
s][
]"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
issuable
.
label_names
.
join
(
","
),
project_id:
(
@project
.
id
if
@project
),
issue_update:
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
issuable
.
id
,
:json
),
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