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
753fd381
Commit
753fd381
authored
Sep 04, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify 'collapsedWeightLabel' computed value
parent
cb449e70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
...p/assets/javascripts/sidebar/components/weight/weight.vue
+9
-19
No files found.
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
View file @
753fd381
...
@@ -66,24 +66,13 @@ export default {
...
@@ -66,24 +66,13 @@ export default {
return
this
.
checkIfNoValue
(
this
.
weight
);
return
this
.
checkIfNoValue
(
this
.
weight
);
},
},
collapsedWeightLabel
()
{
collapsedWeightLabel
()
{
let
label
=
this
.
weight
;
return
this
.
checkIfNoValue
(
this
.
weight
)
if
(
this
.
checkIfNoValue
(
this
.
weight
))
{
?
this
.
noValueLabel
label
=
this
.
noValueLabel
;
:
this
.
weight
.
toString
().
substr
(
0
,
5
);
}
// Truncate with ellipsis after five digits
if
(
this
.
weight
>
99999
)
{
label
=
`
${
this
.
weight
.
toString
().
substr
(
0
,
5
)}
…`
;
}
return
label
;
},
},
noValueLabel
()
{
noValueLabel
()
{
return
s__
(
'
Sidebar|None
'
);
return
s__
(
'
Sidebar|None
'
);
},
},
changeWeightLabel
()
{
return
s__
(
'
Sidebar|Change weight
'
);
},
dropdownToggleLabel
()
{
dropdownToggleLabel
()
{
let
label
=
this
.
weight
;
let
label
=
this
.
weight
;
if
(
this
.
checkIfNoValue
(
this
.
weight
))
{
if
(
this
.
checkIfNoValue
(
this
.
weight
))
{
...
@@ -166,11 +155,12 @@ export default {
...
@@ -166,11 +155,12 @@ export default {
>
>
<gl-icon
:size=
"16"
name=
"weight"
/>
<gl-icon
:size=
"16"
name=
"weight"
/>
<gl-loading-icon
v-if=
"fetching"
class=
"js-weight-collapsed-loading-icon"
/>
<gl-loading-icon
v-if=
"fetching"
class=
"js-weight-collapsed-loading-icon"
/>
<span
<span
v-else
class=
"js-weight-collapsed-weight-label"
>
v-else
{{
collapsedWeightLabel
v-safe-html=
"collapsedWeightLabel"
}}
<template
v-if=
"weight > 99999"
class=
"js-weight-collapsed-weight-label"
>
…
</
template
></span>
>
</span>
</div>
</div>
<div
class=
"title hide-collapsed"
>
<div
class=
"title hide-collapsed"
>
{{ s__('Sidebar|Weight') }}
{{ s__('Sidebar|Weight') }}
...
...
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