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
82ef4f1e
Commit
82ef4f1e
authored
Jul 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with label select not correctly showing selected values
parent
7f0ccbac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+4
-4
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+11
-12
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
82ef4f1e
...
@@ -486,7 +486,7 @@ class GitLabDropdown
...
@@ -486,7 +486,7 @@ class GitLabDropdown
# Toggle the dropdown label
# Toggle the dropdown label
if
@
options
.
toggleLabel
if
@
options
.
toggleLabel
@
updateLabel
(
selectedObject
,
el
,
@
)
@
updateLabel
(
selectedObject
,
el
,
@
,
false
)
else
else
selectedObject
selectedObject
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
...
@@ -515,7 +515,7 @@ class GitLabDropdown
...
@@ -515,7 +515,7 @@ class GitLabDropdown
# Toggle the dropdown label
# Toggle the dropdown label
if
@
options
.
toggleLabel
if
@
options
.
toggleLabel
@
updateLabel
(
selectedObject
,
el
,
@
)
@
updateLabel
(
selectedObject
,
el
,
@
,
true
)
if
value
?
if
value
?
if
!
field
.
length
and
fieldName
if
!
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
@
addInput
(
fieldName
,
value
)
...
@@ -616,8 +616,8 @@ class GitLabDropdown
...
@@ -616,8 +616,8 @@ class GitLabDropdown
# Scroll the dropdown content up
# Scroll the dropdown content up
$dropdownContent
.
scrollTop
(
listItemTop
-
dropdownContentTop
)
$dropdownContent
.
scrollTop
(
listItemTop
-
dropdownContentTop
)
updateLabel
:
(
selected
=
null
,
el
=
null
,
instance
=
null
)
=>
updateLabel
:
(
selected
=
null
,
el
=
null
,
instance
=
null
,
added
=
false
)
=>
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selected
,
el
,
instance
)
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selected
,
el
,
instance
,
added
)
$
.
fn
.
glDropdown
=
(
opts
)
->
$
.
fn
.
glDropdown
=
(
opts
)
->
return
@
.
each
->
return
@
.
each
->
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
82ef4f1e
...
@@ -24,6 +24,7 @@ class @LabelsSelect
...
@@ -24,6 +24,7 @@ class @LabelsSelect
$newLabelError
=
$
(
'.js-label-error'
)
$newLabelError
=
$
(
'.js-label-error'
)
$colorPreview
=
$
(
'.js-dropdown-label-color-preview'
)
$colorPreview
=
$
(
'.js-dropdown-label-color-preview'
)
$newLabelCreateButton
=
$
(
'.js-new-label-btn'
)
$newLabelCreateButton
=
$
(
'.js-new-label-btn'
)
selectedLabels
=
[]
$newLabelError
.
hide
()
$newLabelError
.
hide
()
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
...
@@ -272,19 +273,17 @@ class @LabelsSelect
...
@@ -272,19 +273,17 @@ class @LabelsSelect
fields
:
[
'title'
]
fields
:
[
'title'
]
selectable
:
true
selectable
:
true
filterable
:
true
filterable
:
true
toggleLabel
:
(
selected
,
el
)
->
toggleLabel
:
(
selected
,
el
,
e
,
added
)
->
selected_labels
=
$
(
'.js-label-select'
).
siblings
(
'.dropdown-menu-labels'
).
find
(
'.is-active'
)
if
added
selectedLabels
.
push
selected
.
title
if
selected
and
selected
.
title
?
if
selected_labels
.
length
>
1
"
#{
selected
.
title
}
+
#{
selected_labels
.
length
-
1
}
more"
else
else
selected
.
title
index
=
selectedLabels
.
indexOf
selected
.
title
else
if
not
selected
and
selected_labels
.
length
isnt
0
selectedLabels
.
splice
index
,
1
if
selected_labels
.
length
>
1
"
#{
$
(
selected_labels
[
0
]).
text
()
}
+
#{
selected_labels
.
length
-
1
}
more"
if
selectedLabels
.
length
>
1
else
if
selected_labels
.
length
is
1
"
#{
selectedLabels
[
0
]
}
+
#{
selectedLabels
.
length
-
1
}
more"
$
(
selected_labels
).
text
()
else
if
selectedLabels
.
length
is
1
selectedLabels
[
0
]
else
else
defaultLabel
defaultLabel
fieldName
:
$dropdown
.
data
(
'field-name'
)
fieldName
:
$dropdown
.
data
(
'field-name'
)
...
...
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