Style resolved comments in the current file pane.

This commit is contained in:
Paulo Reis 2016-11-21 11:16:23 +00:00
parent cc8fdf6b8d
commit ad857a15f9
3 changed files with 20 additions and 2 deletions

View file

@ -25,6 +25,8 @@
users="users"
on-resolve="resolveComment(entry, entry_id)"
on-unresolve="unresolveComment(entry_id)"
on-show-thread="showThread(entry)"
on-hide-thread="hideThread(entry)"
on-delete="deleteComment(entry_id)"
on-reply="submitReply(entry, entry_id);"
on-indicator-click="toggleReviewPanel();"
@ -158,12 +160,15 @@ script(type='text/ng-template', id='commentEntryTemplate')
placeholder="{{ 'Hit \"Enter\" to reply' + (entry.resolved ? ' and re-open' : '') }}"
)
.rp-comment-resolved-description(ng-if="entry.resolved && !entry.showWhenResolved")
| Resolved Comment
a(href, ng-click="entry.showWhenResolved = true") Show
| Resolved comment
.rp-entry-actions
a.rp-entry-button(href, ng-click="onResolve();", ng-if="!entry.resolved")
i.fa.fa-check
|  Mark as resolved
a.rp-entry-button(href, ng-click="onShowThread();", ng-if="entry.resolved && !entry.showWhenResolved")
|  Show
a.rp-entry-button(href, ng-click="onHideThread();", ng-if="entry.resolved && entry.showWhenResolved")
|  Hide
a.rp-entry-button(href, ng-click="onUnresolve();", ng-if="entry.resolved")
|  Re-open
a.rp-entry-button(href, ng-click="onDelete();", ng-if="entry.resolved")

View file

@ -143,6 +143,7 @@ define [
$scope.resolveComment = (entry, entry_id) ->
entry.showWhenResolved = false
entry.focused = false
$scope.$broadcast "comment:resolve", entry_id
$scope.unresolveComment = (entry_id) ->
@ -151,6 +152,16 @@ define [
$scope.deleteComment = (entry_id) ->
$scope.$broadcast "comment:remove", entry_id
$scope.showThread = (entry) ->
entry.showWhenResolved = true
$timeout () ->
$scope.$broadcast "review-panel:layout"
$scope.hideThread = (entry) ->
entry.showWhenResolved = false
$timeout () ->
$scope.$broadcast "review-panel:layout"
$scope.setSubView = (subView) ->
$scope.reviewPanel.subView = subView

View file

@ -12,6 +12,8 @@ define [
onIndicatorClick: "&"
onDelete: "&"
onUnresolve: "&"
onShowThread: "&"
onHideThread: "&"
link: (scope, element, attrs) ->
scope.handleCommentReplyKeyPress = (ev) ->
if ev.keyCode == 13 and !ev.shiftKey and !ev.ctrlKey and !ev.metaKey