overleaf/services/web/public/coffee/ide/review-panel/directives/resolvedCommentEntry.coffee

21 lines
539 B
CoffeeScript
Raw Normal View History

define [
"base"
], (App) ->
App.directive "resolvedCommentEntry", () ->
restrict: "E"
templateUrl: "resolvedCommentEntryTemplate"
2017-01-10 05:33:54 -05:00
scope:
thread: "="
permissions: "="
2017-01-10 05:33:54 -05:00
onUnresolve: "&"
onDelete: "&"
link: (scope, element, attrs) ->
scope.contentLimit = 40
scope.needsCollapsing = false
scope.isCollapsed = true
scope.toggleCollapse = () ->
scope.isCollapsed = !scope.isCollapsed
scope.$watch "thread.content.length", (contentLength) ->
scope.needsCollapsing = contentLength > scope.contentLimit