From 961830a1ab076db70577df735f43cae5e8559e83 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 29 May 2012 14:55:19 -0700 Subject: Moving layout and stageDeps' handleOpenDocument into stage. Signed-off-by: Nivesh Rajbhandari --- js/stage/layout.js | 3 +-- js/stage/stage-deps.js | 24 +----------------------- js/stage/stage.reel/stage.js | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 27 deletions(-) (limited to 'js/stage') diff --git a/js/stage/layout.js b/js/stage/layout.js index 7b4ccc17..4eecd4d5 100755 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -140,9 +140,8 @@ exports.Layout = Montage.create(Component, { if(this.stage.appModel.show3dGrid) { this.application.ninja.stage.stageDeps.snapManager.updateWorkingPlaneFromView(); - drawUtils.drawWorkingPlane(); } - + drawUtils.drawWorkingPlane(); drawUtils.draw3DCompass(); } }, diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js index 2469ba79..b45315b7 100755 --- a/js/stage/stage-deps.js +++ b/js/stage/stage-deps.js @@ -55,28 +55,6 @@ exports.StageDeps = Montage.create(Component, { drawUtils.snapManager = snapManager; drawUtils.ElementPlanes = ElementPlanes; } - }, - - handleOpenDocument: { - value: function() { - - workingPlane = [0,0,1,0]; - - snapManager._isCacheInvalid = true; - snapManager.setupDragPlaneFromPlane (workingPlane); - - drawUtils.initializeFromDocument(); - } - }, - - handleSwitchDocument: { - value: function(){ - workingPlane = [0,0,1,0]; - - snapManager._isCacheInvalid = true; - snapManager.setupDragPlaneFromPlane (workingPlane); - - drawUtils.initializeFromDocument(); - } } + }); \ No newline at end of file diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index d8684739..44d6eadb 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -305,8 +305,7 @@ exports.Stage = Montage.create(Component, { this._scrollLeft = 0; this._scrollTop = 0; - this.stageDeps.handleOpenDocument(); - this.layout.handleOpenDocument(); + this.initialize3DOnOpenDocument(); if(designView._template) { var initialLeft = parseInt((this.canvas.width - designView._template.size.width)/2); @@ -1079,6 +1078,18 @@ exports.Stage = Montage.create(Component, { this.application.ninja.toolsSplitter.restore(); this.application.ninja.optionsSplitter.restore(); } + }, + + initialize3DOnOpenDocument: { + value: function() { + + workingPlane = [0,0,1,0]; + + this.snapManager._isCacheInvalid = true; + this.snapManager.setupDragPlaneFromPlane (workingPlane); + + this.drawUtils.initializeFromDocument(); + } } }); \ No newline at end of file -- cgit v1.2.3