From d2bba0eb60c2361e337ebedfcf55492458ed10fd Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 11 May 2018 17:53:22 +0100 Subject: [PATCH] Fix firefox not closing contextmenu correctly --- .../aceEditor/spell-check/SpellCheckManager.coffee | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee index 3d274abea4..6cc95d58c4 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee @@ -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