mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 06:03:03 +00:00
Fix firefox not closing contextmenu correctly
This commit is contained in:
parent
9c56f6c2fc
commit
d2bba0eb60
1 changed files with 4 additions and 6 deletions
|
@ -17,6 +17,10 @@ define [], () ->
|
|||
@$scope.replaceWord = @adapter.replaceWord
|
||||
@$scope.learnWord = @learnWord
|
||||
|
||||
$(document).on 'click', (e) =>
|
||||
@closeContextMenu() if e.which != 3 # Ignore if right click
|
||||
return true
|
||||
|
||||
init: () ->
|
||||
@updatedLines = Array(@adapter.getLines().length).fill(true)
|
||||
@runSpellCheckSoon(200) if @isSpellCheckEnabled()
|
||||
|
@ -58,14 +62,8 @@ define [], () ->
|
|||
left: coords.x + 'px'
|
||||
highlight: highlight
|
||||
}
|
||||
@setUpClickOffContextMenuListener()
|
||||
return false
|
||||
|
||||
setUpClickOffContextMenuListener: () ->
|
||||
$(document).one 'click', (e) =>
|
||||
@closeContextMenu() if e.which != 3 # Ignore if right click
|
||||
return true
|
||||
|
||||
closeContextMenu: () ->
|
||||
# This is triggered on scroll, so for performance only apply setting when
|
||||
# it changes
|
||||
|
|
Loading…
Reference in a new issue