From b056b4bef5982466d80d72e5cbb31e63087990e1 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 24 Feb 2012 15:30:55 -0800 Subject: - added closeDocument event for timeline - minor bug fixes Signed-off-by: Ananya Sen --- js/controllers/document-controller.js | 4 ++++ js/helper-classes/3D/draw-utils.js | 4 ++-- js/mediators/keyboard-mediator.js | 8 +++++++- js/stage/layout.js | 5 +++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 714d1404..02031922 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -338,6 +338,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.application.ninja.stage.hideCanvas(true); } + + NJevent("closeDocument", doc.uri); + + doc=null; } }, diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 37fc1cfc..85870097 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -126,8 +126,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this.setWorkingPlane( Vector.create( [0,0,1,0] ) ); //Loop through all the top-level children of the current document and call drawUtils.addElement on them - if(this.application.ninja.currentDocument.documentRoot.hasChildNodes()){ - documentRootChildren = this.application.ninja.currentDocument.documentRoot.childNodes; + if(this.application.ninja.currentDocument._liveNodeList.length > 0){ + documentRootChildren = this.application.ninja.currentDocument._liveNodeList; for(i=0;i