From 3ab0aee30c109156b957e14fcd9e6dd4b315cf27 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 10 Jun 2021 12:26:27 +0100 Subject: [PATCH] Merge pull request #4131 from overleaf/ae-uneditable-file-outline Notify the outline manager when a file is opened GitOrigin-RevId: 246da98f1b9a433aeeb8e5b420ad0999544778c3 --- .../web/frontend/js/features/outline/outline-manager.js | 6 ++++++ .../web/frontend/js/ide/binary-files/BinaryFilesManager.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/outline/outline-manager.js b/services/web/frontend/js/features/outline/outline-manager.js index 5daac16d9c..cde836fed2 100644 --- a/services/web/frontend/js/features/outline/outline-manager.js +++ b/services/web/frontend/js/features/outline/outline-manager.js @@ -42,6 +42,12 @@ class OutlineManager { this.broadcastChangeEvent() }) + scope.$on('file-view:file-opened', () => { + this.isTexFile = false + this.updateOutline() + this.broadcastChangeEvent() + }) + scope.$on('cursor:editor:update', (event, cursorPosition) => { if (this.ignoreNextCursorUpdate) { this.ignoreNextCursorUpdate = false diff --git a/services/web/frontend/js/ide/binary-files/BinaryFilesManager.js b/services/web/frontend/js/ide/binary-files/BinaryFilesManager.js index d222030165..1caefef90e 100644 --- a/services/web/frontend/js/ide/binary-files/BinaryFilesManager.js +++ b/services/web/frontend/js/ide/binary-files/BinaryFilesManager.js @@ -31,7 +31,10 @@ export default BinaryFilesManager = class BinaryFilesManager { return window.setTimeout( () => { this.$scope.openFile = file - return this.$scope.$apply() + + this.$scope.$apply() + + this.$scope.$broadcast('file-view:file-opened') }, 0, this