Add directive to show change entries.

This commit is contained in:
Paulo Reis 2017-05-31 14:47:25 +01:00
parent 17acede8ce
commit a6108480f5
2 changed files with 31 additions and 0 deletions

View file

@ -5,6 +5,7 @@ define [
"ide/review-panel/directives/reviewPanelSorted"
"ide/review-panel/directives/reviewPanelToggle"
"ide/review-panel/directives/changeEntry"
"ide/review-panel/directives/aggregateChangeEntry"
"ide/review-panel/directives/commentEntry"
"ide/review-panel/directives/addCommentEntry"
"ide/review-panel/directives/bulkActionsEntry"

View file

@ -0,0 +1,30 @@
define [
"base"
], (App) ->
App.directive "aggregateChangeEntry", ($timeout) ->
restrict: "E"
templateUrl: "aggregateChangeEntryTemplate"
scope:
entry: "="
user: "="
permissions: "="
onAccept: "&"
onReject: "&"
onIndicatorClick: "&"
onBodyClick: "&"
link: (scope, element, attrs) ->
scope.contentLimit = 40
scope.isCollapsed = true
scope.needsCollapsing = false
element.on "click", (e) ->
if $(e.target).is('.rp-entry, .rp-entry-description, .rp-entry-body, .rp-entry-action-icon i')
scope.onBodyClick()
scope.toggleCollapse = () ->
scope.isCollapsed = !scope.isCollapsed
$timeout () ->
scope.$emit "review-panel:layout"
# scope.$watch "entry.content.length", (contentLength) ->
# scope.needsCollapsing = contentLength > scope.contentLimit