mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1288 from sharelatex/cmg-cancel-comments-ff
Make comments cancel when you cancel them on firefox GitOrigin-RevId: 68b8be1ac34f0510103f3b9a8e7b617988fb55de
This commit is contained in:
parent
2b556df43c
commit
366dbbd54f
1 changed files with 11 additions and 6 deletions
|
@ -50,13 +50,18 @@ define(['base'], App =>
|
|||
|
||||
return (scope.submitNewComment = function(event) {
|
||||
// If this is from a blur event from clicking on cancel, ignore it.
|
||||
if (
|
||||
event != null &&
|
||||
event.type === 'blur' &&
|
||||
$(event.relatedTarget).hasClass('rp-entry-button-cancel')
|
||||
) {
|
||||
return true
|
||||
if (event != null && event.type === 'blur') {
|
||||
if (
|
||||
// Includes relatedTarget workaround for Firefox
|
||||
$(event.relatedTarget).hasClass('rp-entry-button-cancel') ||
|
||||
$(event.originalEvent.explicitOriginalTarget).hasClass(
|
||||
'rp-entry-button-cancel'
|
||||
)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
scope.onSubmit({ content: scope.state.content })
|
||||
scope.state.isAdding = false
|
||||
return (scope.state.content = '')
|
||||
|
|
Loading…
Reference in a new issue