From 7fcb10270f9e19415f8452c261c2d0c86916a29a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 1 Jun 2012 00:54:02 -0700 Subject: fixed the 3d grid when switching documents and some cleanup Signed-off-by: Valerio Virgillito --- js/models/app-model.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'js/models/app-model.js') diff --git a/js/models/app-model.js b/js/models/app-model.js index 1c599a32..ceba653e 100755 --- a/js/models/app-model.js +++ b/js/models/app-model.js @@ -9,6 +9,32 @@ var Montage = require("montage/core/core").Montage, exports.AppModel = Montage.create(Component, { + _currentDocument: { + value : null + }, + + currentDocument : { + get : function() { + return this._currentDocument; + }, + set : function(value) { + if (value === this._currentDocument) { + return; + } + + if(this._currentDocument && this._currentDocument.currentView === "design") { + this._currentDocument.model.draw3DGrid = this.show3dGrid; + } + + this._currentDocument = value; + + if(this._currentDocument && this._currentDocument.currentView === "design") { + this.show3dGrid = this._currentDocument.model.draw3DGrid; + } + + } + }, + _livePreview: { value: false }, -- cgit v1.2.3