Merge pull request #3538 from overleaf/ta-file-tree-no-selection

[ReactFileTree] Update Editor View on Empty Selection

GitOrigin-RevId: 18744cd64c2a012488c3d0969549ae464e752a4b
This commit is contained in:
Timothée Alby 2021-01-07 15:22:53 +01:00 committed by Copybot
parent 2ca6d2dadb
commit e7c4ce6e80
2 changed files with 8 additions and 0 deletions

View file

@ -58,6 +58,8 @@ App.controller('ReactFileTreeController', function(
$scope.$emit('entities:multiSelected', {
count: selectedEntities.length
})
} else {
$scope.$emit('entity:no-selection')
}
}
})

View file

@ -48,6 +48,12 @@ export default EditorManager = (function() {
}
})
this.$scope.$on('entity:no-selection', () => {
this.$scope.$apply(() => {
this.$scope.ui.view = null
})
})
this.$scope.$on('entity:deleted', (event, entity) => {
if (this.$scope.editor.open_doc_id === entity.id) {
if (!this.$scope.project.rootDoc_id) {