overleaf/services/web/public/coffee/ide/review-panel/directives/resolvedCommentEntry.coffee
2017-01-18 10:53:59 +00:00

23 lines
No EOL
597 B
CoffeeScript

define [
"base"
], (App) ->
App.directive "resolvedCommentEntry", () ->
restrict: "E"
templateUrl: "resolvedCommentEntryTemplate"
scope:
thread: "="
permissions: "="
onUnresolve: "&"
onDelete: "&"
link: (scope, element, attrs) ->
scope.contentLimit = 40
scope.needsCollapsing = false
scope.isCollapsed = true
scope.toggleCollapse = () ->
scope.isCollapsed = !scope.isCollapsed
$timeout () ->
scope.$emit "review-panel:layout"
scope.$watch "thread.content.length", (contentLength) ->
scope.needsCollapsing = contentLength > scope.contentLimit