overleaf/services/web/public/coffee/ide/review-panel/directives/commentEntry.coffee
2016-12-16 16:42:41 +00:00

23 lines
No EOL
522 B
CoffeeScript

define [
"base"
], (App) ->
App.directive "commentEntry", () ->
restrict: "E"
templateUrl: "commentEntryTemplate"
scope:
entry: "="
threads: "="
onResolve: "&"
onReply: "&"
onIndicatorClick: "&"
onDelete: "&"
onUnresolve: "&"
onShowThread: "&"
onHideThread: "&"
link: (scope, element, attrs) ->
scope.handleCommentReplyKeyPress = (ev) ->
if ev.keyCode == 13 and !ev.shiftKey and !ev.ctrlKey and !ev.metaKey
ev.preventDefault()
ev.target.blur()
scope.onReply()