Don't try to open deleted docs for editing

This commit is contained in:
James Allen 2014-06-11 11:53:46 +01:00
parent 3ddfa607e1
commit 54ecab854d

View file

@ -94,7 +94,13 @@ define [
@ide.editor.enable()
@ide.fileViewManager.enable()
@disable()
@ide.fileTreeManager.openDoc(@doc_id)
doc = @ide.fileTreeManager.getEntity(@doc_id, include_deleted: true)
if doc? and doc.get("deleted")
@ide.fileTreeManager.openDoc(@ide.project.get("rootDoc_id"))
else
@ide.fileTreeManager.openDoc(@doc_id)
@ide.tabManager.show "code"
@resetLabels()
@ide.fileTreeManager.makeReadWriteIfAllowed()