optimise common case for closing context menu (triggered on scroll)

This commit is contained in:
Brian Gough 2015-01-23 20:46:44 +00:00
parent e62a2c7a6f
commit 5244fddce2

View file

@ -86,8 +86,11 @@ define [
return false return false
closeContextMenu: (e) -> closeContextMenu: (e) ->
@$scope.$apply () => # this is triggered on scroll, so for performance only apply
@$scope.spellingMenu.open = false # setting when it changes
if @$scope?.spellingMenu?.open != false
@$scope.$apply () =>
@$scope.spellingMenu.open = false
replaceWord: (highlight, text) -> replaceWord: (highlight, text) ->
@editor.getSession().replace(new Range( @editor.getSession().replace(new Range(