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
7892570f
Commit
7892570f
authored
Mar 30, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] refactor and remove show more assignees
parent
098beb7d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
42 deletions
+33
-42
app/assets/javascripts/vue_sidebar_assignees/components/expanded/multiple_assignees.js
...debar_assignees/components/expanded/multiple_assignees.js
+33
-18
app/assets/javascripts/vue_sidebar_assignees/components/expanded/show_more_assignees.js
...ebar_assignees/components/expanded/show_more_assignees.js
+0
-24
No files found.
app/assets/javascripts/vue_sidebar_assignees/components/expanded/multiple_assignees.js
View file @
7892570f
import
ShowMoreAssignees
from
'
./show_more_assignees
'
;
export
default
{
name
:
'
MultipleAssignees
'
,
data
()
{
return
{
showMore
:
false
,
showLess
:
true
,
defaultRenderCount
:
5
,
};
},
props
:
{
...
...
@@ -14,41 +13,57 @@ export default {
rootPath
()
{
return
this
.
assignees
.
rootPath
;
},
shouldShowMoreAssignees
()
{
return
this
.
assignees
.
users
.
length
>
5
;
renderShowMoreSection
()
{
return
this
.
assignees
.
users
.
length
>
this
.
defaultRenderCount
;
},
numberOfHiddenAssignees
()
{
return
this
.
showMore
?
0
:
this
.
assignees
.
users
.
length
-
5
;
return
this
.
assignees
.
users
.
length
-
this
.
defaultRenderCount
;
},
toggleShowMore
()
{
return
function
toggleShowMore
()
{
this
.
showMore
=
!
this
.
showMore
;
}.
bind
(
this
);
isHiddenAssignees
()
{
return
this
.
numberOfHiddenAssignees
>
0
;
},
},
components
:
{
'
show-more-assignees
'
:
ShowMoreAssignees
,
methods
:
{
toggleShowLess
()
{
this
.
showLess
=
!
this
.
showLess
;
},
renderAssignee
(
index
)
{
return
!
this
.
showLess
||
(
index
<
this
.
defaultRenderCount
&&
this
.
showLess
);
},
assigneeUrl
(
username
)
{
return
`
${
this
.
rootPath
}${
username
}
`
;
},
assigneeAlt
(
name
)
{
return
`
${
name
}
's avatar`
;
},
},
template
:
`
<div class="hide-collapsed">
<div class="hide-collapsed">
<div class="user-list">
<div class="user-item" v-for="(user, index) in assignees.users"
v-if="
showMore || (index < 5 && !showMore
)" >
v-if="
renderAssignee(index
)" >
<a class="user-link has-tooltip"
data-placement="bottom"
:href="
rootPath + user.username
"
:href="
assigneeUrl(user.username)
"
:data-title="user.name" >
<img width="32"
class="avatar avatar-inline s32"
:alt="
user.name + '\\'s avatar'
"
:alt="
assigneeAlt(user.name)
"
:src="user.avatarUrl" >
</a>
</div>
</div>
<show-more-assignees v-if="shouldShowMoreAssignees"
:hiddenAssignees="numberOfHiddenAssignees"
:toggle="toggleShowMore" />
<div class="user-list-more" v-if="renderShowMoreSection">
<button type="button" class="btn-link" @click="toggleShowLess">
<template v-if="showLess">
+ {{numberOfHiddenAssignees}} more
</template>
<template v-else>
- show less
</template>
</button>
</div>
</div>
</div>
`
,
...
...
app/assets/javascripts/vue_sidebar_assignees/components/expanded/show_more_assignees.js
deleted
100644 → 0
View file @
098beb7d
export
default
{
name
:
'
ShowMoreAssignees
'
,
props
:
{
hiddenAssignees
:
{
type
:
Number
,
required
:
true
},
toggle
:
{
type
:
Function
,
required
:
true
},
},
computed
:
{
showMore
()
{
return
this
.
hiddenAssignees
>
0
;
},
},
template
:
`
<div class="user-list-more">
<button type="button" class="btn-link" @click="toggle">
<template v-if="showMore">
+ {{hiddenAssignees}} more
</template>
<template v-else>
- show less
</template>
</button>
</div>
`
,
};
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