From 3b066758bb531a681112ea87459e66058eeee043 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 13 Jun 2017 14:06:00 +0100 Subject: [PATCH] Don't load labels for anonymous/read-only users --- services/web/app/views/project/editor/editor.pug | 4 ++-- .../web/public/coffee/ide/editor/directives/aceEditor.coffee | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index 5ea0107da5..3ae571f224 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -37,9 +37,9 @@ div.full-size( keybindings="settings.mode", font-size="settings.fontSize", auto-complete="settings.autoComplete", - enable-auto-complete-features="true", + enable-auto-complete-features="!anonymous" spell-check="!anonymous", - spell-check-language="project.spellCheckLanguage", + spell-check-language="project.spellCheckLanguage" highlights="onlineUserCursorHighlights[editor.open_doc_id]" show-print-margin="false", sharejs-doc="editor.sharejs_doc", diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 36639a299d..9e231cc30a 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -44,6 +44,7 @@ define [ keybindings: "=" fontSize: "=" autoComplete: "=" + enableAutoCompleteFeatures: "=" sharejsDoc: "=" spellCheck: "=" spellCheckLanguage: "=" @@ -94,7 +95,7 @@ define [ highlightsManager = new HighlightsManager(scope, editor, element) cursorPositionManager = new CursorPositionManager(scope, editor, element, localStorage) trackChangesManager = new TrackChangesManager(scope, editor, element) - if attrs.enableAutoCompleteFeatures + if scope.enableAutoCompleteFeatures labelsManager = new LabelsManager(scope, editor, element, labels) autoCompleteManager = new AutoCompleteManager(scope, editor, element, labelsManager)