overleaf/services/web/public/coffee/ide/review-panel/directives/changeEntry.coffee
2017-01-13 15:30:31 +00:00

22 lines
No EOL
540 B
CoffeeScript

define [
"base"
], (App) ->
App.directive "changeEntry", ($timeout) ->
restrict: "E"
templateUrl: "changeEntryTemplate"
scope:
entry: "="
user: "="
permissions: "="
onAccept: "&"
onReject: "&"
onIndicatorClick: "&"
link: (scope, element, attrs) ->
scope.contentLimit = 40
scope.needsCollapsing = scope.entry.content.length > scope.contentLimit
scope.isCollapsed = true
scope.toggleCollapse = () ->
scope.isCollapsed = !scope.isCollapsed
$timeout () ->
scope.$emit "review-panel:layout"