Add collapsing behaviour to resolved comments.

This commit is contained in:
Paulo Reis 2017-01-13 15:37:24 +00:00
parent 5eece9f5d9
commit 3968761ac8
2 changed files with 17 additions and 2 deletions

View file

@ -206,7 +206,13 @@ script(type='text/ng-template', id='resolvedCommentEntryTemplate')
.rp-resolved-comment-context
| Quoted text on 
span.rp-resolved-comment-context-file {{ thread.docName }}
p.rp-resolved-comment-context-quote {{ thread.content }}
p.rp-resolved-comment-context-quote
span {{ thread.content | limitTo:(isCollapsed ? contentLimit : thread.content.length)}}
a.rp-collapse-toggle(
href
ng-if="needsCollapsing"
ng-click="toggleCollapse();"
)  {{ isCollapsed ? '(more)' : '(less)' }}
.rp-comment(
ng-repeat="comment in thread.messages track by comment.id"
)

View file

@ -8,4 +8,13 @@ define [
thread: "="
permissions: "="
onUnresolve: "&"
onDelete: "&"
onDelete: "&"
link: (scope, element, attrs) ->
scope.contentLimit = 40
scope.needsCollapsing = scope.thread.content.length > scope.contentLimit
scope.isCollapsed = true
scope.toggleCollapse = () ->
scope.isCollapsed = !scope.isCollapsed
$timeout () ->
scope.$emit "review-panel:layout"