From 9e4ee2470726e3334eb47d904a6f4079d4ed7aef Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 17:01:39 -0800 Subject: IKNINJA-1270: fixed browser crashing when you close a document while playing a video then wait for a while Signed-off-by: Ananya Sen --- js/helper-classes/3D/draw-utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/helper-classes') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 02d946ae..63e7799a 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -112,6 +112,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this.eventManager.addEventListener("elementDeleted", this, false); this.eventManager.addEventListener("deleteSelection", this, false); this.eventManager.addEventListener("elementChange", this, false); + this.eventManager.addEventListener("closeDocument", this, false); } }, @@ -135,6 +136,15 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { } }, + handleCloseDocument:{ + value: function() { + if(this.application.ninja.documentController._documents.length === 0){ + this._eltArray = []; + this._planesArray = []; + } + } + }, + handleElementAdded: { value: function(event) { this.addElement(event.detail); -- cgit v1.2.3