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

19 lines
443 B
CoffeeScript
Raw Normal View History

2016-11-16 10:12:58 -05:00
define [
"base"
], (App) ->
App.directive "commentEntry", () ->
restrict: "E"
templateUrl: "commentEntryTemplate"
scope:
entry: "="
2016-12-16 11:42:41 -05:00
threads: "="
2016-11-16 10:12:58 -05:00
onResolve: "&"
onReply: "&"
onIndicatorClick: "&"
2016-11-16 10:12:58 -05:00
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()