From 5244fddce21885508fd61adcdd853ef099b4d639 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 23 Jan 2015 20:46:44 +0000 Subject: [PATCH] optimise common case for closing context menu (triggered on scroll) --- .../aceEditor/spell-check/SpellCheckManager.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 bdddb2ab20..7af794e867 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 @@ -86,8 +86,11 @@ define [ return false closeContextMenu: (e) -> - @$scope.$apply () => - @$scope.spellingMenu.open = false + # this is triggered on scroll, so for performance only apply + # setting when it changes + if @$scope?.spellingMenu?.open != false + @$scope.$apply () => + @$scope.spellingMenu.open = false replaceWord: (highlight, text) -> @editor.getSession().replace(new Range(