mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
Navigate away from deleted docs. Closes #141
This commit is contained in:
@@ -15,6 +15,13 @@ define [
|
||||
if (@$scope.ui.view != "track-changes" and entity.type == "doc")
|
||||
@openDoc(entity)
|
||||
|
||||
@$scope.$on "entity:deleted", (event, entity) =>
|
||||
if @$scope.editor.open_doc_id == entity.id
|
||||
return if !@$scope.project.rootDoc_id
|
||||
doc = @ide.fileTreeManager.findEntityById(@$scope.project.rootDoc_id)
|
||||
return if !doc?
|
||||
@openDoc(doc)
|
||||
|
||||
initialized = false
|
||||
@$scope.$on "file-tree:initialized", () =>
|
||||
if !initialized
|
||||
|
||||
@@ -320,6 +320,8 @@ define [
|
||||
entity.deleted = true
|
||||
@$scope.deletedDocs.push entity
|
||||
|
||||
@$scope.$emit "entity:deleted", entity
|
||||
|
||||
_moveEntityInScope: (entity, parent_folder) ->
|
||||
return if entity in parent_folder.children
|
||||
@_deleteEntityFromScope(entity, moveToDeleted: false)
|
||||
|
||||
Reference in New Issue
Block a user