mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Navigate away from deleted docs. Closes #141
This commit is contained in:
parent
0d299b308e
commit
753a80ada5
2 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue