mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Don't submit comment on clicking cancel
This commit is contained in:
parent
a4464a330c
commit
fb91219661
2 changed files with 6 additions and 3 deletions
|
@ -340,10 +340,10 @@ script(type='text/ng-template', id='addCommentEntryTemplate')
|
|||
ng-keypress="handleCommentKeyPress($event);"
|
||||
placeholder=translate("add_your_comment_here")
|
||||
focus-on="comment:new:open"
|
||||
ng-blur="submitNewComment()"
|
||||
ng-blur="submitNewComment($event)"
|
||||
)
|
||||
.rp-entry-actions
|
||||
button.rp-entry-button(
|
||||
button.rp-entry-button.rp-entry-button-cancel(
|
||||
ng-click="cancelNewComment();"
|
||||
)
|
||||
i.fa.fa-times
|
||||
|
|
|
@ -31,7 +31,10 @@ define [
|
|||
if scope.state.content.length > 0
|
||||
scope.submitNewComment()
|
||||
|
||||
scope.submitNewComment = () ->
|
||||
scope.submitNewComment = (event) ->
|
||||
# If this is from a blur event from clicking on cancel, ignore it.
|
||||
if event? and event.type == "blur" and $(event.relatedTarget).hasClass("rp-entry-button-cancel")
|
||||
return true
|
||||
scope.onSubmit { content: scope.state.content }
|
||||
scope.state.isAdding = false
|
||||
scope.state.content = ""
|
||||
|
|
Loading…
Reference in a new issue