From 4e43fe2c97833c0847a53484c9589697e64137dc Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 17 May 2012 16:05:26 -0700 Subject: Styles Controller - Null out active document --- js/controllers/styles-controller.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/controllers') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 22f29bd8..c8b9376e 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -83,6 +83,11 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// If the document is null set default stylesheets to null if(!document) { + this._activeDocument = null; + this._stageStylesheet = null; + this.defaultStylesheet = null; + this.userStyleSheets = []; + this.clearDirtyStyleSheets(); return false; } @@ -120,7 +125,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { if(sheet) { this._defaultStylesheet = sheet; } else { - + if(sheet === null) { + this._defaultStylesheet = null; + return false; + } ///// Use the last stylesheet in the document as the default var sheets = this._activeDocument._document.styleSheets, -- cgit v1.2.3