aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage-deps.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-29 00:34:40 -0700
committerValerio Virgillito2012-05-29 00:34:40 -0700
commit4c3aac5eabd93052b1554a03d78235215bb49db4 (patch)
treefe08f4f6d33d81d602f56daeaec845577fb9d8a5 /js/stage/stage-deps.js
parent9a66ccad0235484643ef6d821315b11b5be4a93e (diff)
downloadninja-4c3aac5eabd93052b1554a03d78235215bb49db4.tar.gz
document bindings phase 1
- using array controller to bind the current document to all ninja components - removed open document event - removed references to the document controller Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/stage/stage-deps.js')
-rwxr-xr-xjs/stage/stage-deps.js40
1 files changed, 28 insertions, 12 deletions
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index 896d4a5b..756844fd 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -14,6 +14,34 @@ var Montage = require("montage/core/core").Montage,
14 VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; 14 VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
15 15
16exports.StageDeps = Montage.create(Component, { 16exports.StageDeps = Montage.create(Component, {
17
18 _currentDocument: {
19 value : null,
20 enumerable : false
21 },
22
23 currentDocument : {
24 get : function() {
25 return this._currentDocument;
26 },
27 set : function(value) {
28 if (value === this._currentDocument || value.getProperty("currentView") !== "design") {
29 return;
30 }
31
32 this._currentDocument = value;
33
34 if(this._currentDocument) {
35 workingPlane = [0,0,1,0];
36
37 snapManager._isCacheInvalid = true;
38 snapManager.setupDragPlaneFromPlane (workingPlane);
39
40 drawUtils.initializeFromDocument();
41 }
42 }
43 },
44
17 viewUtils: { 45 viewUtils: {
18 value: viewUtils 46 value: viewUtils
19 }, 47 },
@@ -59,18 +87,6 @@ exports.StageDeps = Montage.create(Component, {
59 } 87 }
60 }, 88 },
61 89
62 handleOpenDocument: {
63 value: function() {
64
65 workingPlane = [0,0,1,0];
66
67 snapManager._isCacheInvalid = true;
68 snapManager.setupDragPlaneFromPlane (workingPlane);
69
70 drawUtils.initializeFromDocument();
71 }
72 },
73
74 handleSwitchDocument: { 90 handleSwitchDocument: {
75 value: function(){ 91 value: function(){
76 workingPlane = [0,0,1,0]; 92 workingPlane = [0,0,1,0];