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

Notify the outline manager when a file is opened

GitOrigin-RevId: 246da98f1b9a433aeeb8e5b420ad0999544778c3
This commit is contained in:
Alf Eaton 2021-06-10 12:26:27 +01:00 committed by Copybot
parent 29b92615ce
commit 3ab0aee30c
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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