mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01: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")
|
if (@$scope.ui.view != "track-changes" and entity.type == "doc")
|
||||||
@openDoc(entity)
|
@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
|
initialized = false
|
||||||
@$scope.$on "file-tree:initialized", () =>
|
@$scope.$on "file-tree:initialized", () =>
|
||||||
if !initialized
|
if !initialized
|
||||||
|
|||||||
@@ -320,6 +320,8 @@ define [
|
|||||||
entity.deleted = true
|
entity.deleted = true
|
||||||
@$scope.deletedDocs.push entity
|
@$scope.deletedDocs.push entity
|
||||||
|
|
||||||
|
@$scope.$emit "entity:deleted", entity
|
||||||
|
|
||||||
_moveEntityInScope: (entity, parent_folder) ->
|
_moveEntityInScope: (entity, parent_folder) ->
|
||||||
return if entity in parent_folder.children
|
return if entity in parent_folder.children
|
||||||
@_deleteEntityFromScope(entity, moveToDeleted: false)
|
@_deleteEntityFromScope(entity, moveToDeleted: false)
|
||||||
|
|||||||
Reference in New Issue
Block a user