Просмотр исходного кода

Merge pull request #4131 from overleaf/ae-uneditable-file-outline

Notify the outline manager when a file is opened

GitOrigin-RevId: 246da98f1b9a433aeeb8e5b420ad0999544778c3
Alf Eaton 5 лет назад
Родитель
Сommit
3ab0aee30c

+ 6 - 0
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

+ 4 - 1
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