2017-01-06 06:59:49 -05:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
App.directive "resolvedCommentEntry", () ->
|
|
|
|
restrict: "E"
|
|
|
|
templateUrl: "resolvedCommentEntryTemplate"
|
2017-01-10 05:33:54 -05:00
|
|
|
scope:
|
2017-01-06 06:59:49 -05:00
|
|
|
thread: "="
|
2017-01-12 05:52:39 -05:00
|
|
|
permissions: "="
|
2017-01-10 05:33:54 -05:00
|
|
|
onUnresolve: "&"
|
2017-01-13 10:37:24 -05:00
|
|
|
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"
|