From 130cd6d4b99c9db344ec0ab44a54a59d11b31d2f Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 8 Mar 2012 13:29:58 -0800 Subject: IKNINJA-1270: fixed browser crashing when you close a document while playing a video 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