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
Jérome Perrin
gitlab-ce
Commits
2d38d35b
Commit
2d38d35b
authored
Aug 30, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed label toggle text
parent
7418873b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+17
-14
No files found.
app/assets/javascripts/labels_select.js
View file @
2d38d35b
...
...
@@ -212,21 +212,24 @@
},
selectable
:
true
,
filterable
:
true
,
selected
:
$dropdown
.
data
(
'
selected
'
)
||
[],
toggleLabel
:
function
(
selected
,
el
)
{
var
selected_labels
;
selected_labels
=
$
(
'
.js-label-select
'
).
siblings
(
'
.dropdown-menu-labels
'
).
find
(
'
.is-active
'
);
if
(
selected
&&
(
selected
.
title
!=
null
))
{
if
(
selected_labels
.
length
>
1
)
{
return
selected
.
title
+
"
+
"
+
(
selected_labels
.
length
-
1
)
+
"
more
"
;
}
else
{
return
selected
.
title
;
}
}
else
if
(
!
selected
&&
selected_labels
.
length
!==
0
)
{
if
(
selected_labels
.
length
>
1
)
{
return
(
$
(
selected_labels
[
0
]).
text
())
+
"
+
"
+
(
selected_labels
.
length
-
1
)
+
"
more
"
;
}
else
if
(
selected_labels
.
length
===
1
)
{
return
$
(
selected_labels
).
text
();
}
var
isSelected
=
el
!==
null
?
el
.
hasClass
(
'
is-active
'
)
:
false
,
title
=
selected
.
title
;
if
(
isSelected
)
{
this
.
selected
.
push
(
title
);
}
else
{
var
index
=
this
.
selected
.
indexOf
(
title
);
this
.
selected
.
splice
(
index
,
1
);
}
var
selectedLabels
=
this
.
selected
;
if
(
selectedLabels
.
length
===
1
)
{
return
selectedLabels
;
}
else
if
(
selectedLabels
.
length
>
1
)
{
return
selectedLabels
[
0
]
+
"
+
"
+
(
selectedLabels
.
length
-
1
)
+
"
more
"
;
}
else
{
return
defaultLabel
;
}
...
...
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