Navigate away from deleted docs. Closes #141

This commit is contained in:
James Allen 2015-02-03 13:51:56 +00:00
parent 0d299b308e
commit 753a80ada5
2 changed files with 9 additions and 0 deletions

View file

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

View file

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