aboutsummaryrefslogtreecommitdiff
path: root/js/models
diff options
context:
space:
mode:
authorJohn Mayhew2012-07-24 15:46:16 -0700
committerJohn Mayhew2012-07-24 15:46:16 -0700
commit9f240b8b9b1f5fb0f145c343ca5e533e25e81374 (patch)
tree407564eaa6466e8d4cf2eeee0c56dc623243586f /js/models
parentd25359c75089215ee48838db081fd3d51cbbd85f (diff)
parent21d74af1e9fc57cc25cea8aa7408beabf79ff2f3 (diff)
downloadninja-9f240b8b9b1f5fb0f145c343ca5e533e25e81374.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja
Diffstat (limited to 'js/models')
-rwxr-xr-xjs/models/app-model.js169
-rwxr-xr-xjs/models/element-model.js8
-rwxr-xr-xjs/models/materials-model.js18
3 files changed, 13 insertions, 182 deletions
diff --git a/js/models/app-model.js b/js/models/app-model.js
index 1fc1ba12..1351921b 100755
--- a/js/models/app-model.js
+++ b/js/models/app-model.js
@@ -34,57 +34,6 @@ var Montage = require("montage/core/core").Montage,
34 34
35exports.AppModel = Montage.create(Component, { 35exports.AppModel = Montage.create(Component, {
36 36
37 _currentDocument: {
38 value : null
39 },
40
41 currentDocument : {
42 get : function() {
43 return this._currentDocument;
44 },
45 set : function(value) {
46 if (value === this._currentDocument) {
47 return;
48 }
49
50 if(this._currentDocument && this._currentDocument.currentView === "design") {
51 this._currentDocument.model.draw3DGrid = this.show3dGrid;
52 }
53
54 this._currentDocument = value;
55
56 if(this._currentDocument && this._currentDocument.currentView === "design") {
57 this.show3dGrid = this._currentDocument.model.draw3DGrid;
58 }
59
60 }
61 },
62
63 _livePreview: {
64 value: false
65 },
66
67 livePreview: {
68 get: function() {
69 return this._livePreview;
70 },
71 set: function(value) {
72 this._livePreview = value;
73 }
74 },
75 _chromePreview: {
76 value: false
77 },
78
79 chromePreview: {
80 get: function() {
81 return this._chromePreview;
82 },
83 set: function(value) {
84 this._chromePreview = value;
85 }
86 },
87
88 _layoutView: { 37 _layoutView: {
89 value: "layoutAll" 38 value: "layoutAll"
90 }, 39 },
@@ -98,67 +47,6 @@ exports.AppModel = Montage.create(Component, {
98 } 47 }
99 }, 48 },
100 49
101 _layoutAll: {
102 value: true
103 },
104
105 layoutAll: {
106 get: function() {
107 return this._layoutAll;
108 },
109 set: function(value) {
110
111 if(value) {
112 this.layoutView = "layoutAll";
113 this.layoutItems = false;
114 this.layoutOff = false;
115 }
116
117 this._layoutAll = value;
118
119 }
120 },
121
122 _layoutItems: {
123 value: false
124 },
125
126 layoutItems: {
127 get: function() {
128 return this._layoutItems;
129 },
130 set: function(value) {
131
132 if(value) {
133 this.layoutView = "layoutItems";
134 this.layoutAll = false;
135 this.layoutOff = false;
136 }
137
138 this._layoutItems = value;
139 }
140 },
141
142 _layoutOff: {
143 value: false
144 },
145
146 layoutOff: {
147 get: function() {
148 return this._layoutOff;
149 },
150 set: function(value) {
151
152 if(value) {
153 this.layoutView = "layoutOff";
154 this.layoutAll = false;
155 this.layoutItems = false;
156 }
157
158 this._layoutOff = value;
159 }
160 },
161
162 _snap: { 50 _snap: {
163 value: true 51 value: true
164 }, 52 },
@@ -237,63 +125,6 @@ exports.AppModel = Montage.create(Component, {
237 } 125 }
238 }, 126 },
239 127
240 _frontStageView: {
241 value: true
242 },
243
244 frontStageView: {
245 get: function() {
246 return this._frontStageView;
247 },
248 set: function(value) {
249 if(value) {
250 this.documentStageView = "front";
251 this.topStageView = false;
252 this.sideStageView = false;
253 }
254
255 this._frontStageView = value;
256 }
257 },
258
259 _topStageView: {
260 value: false
261 },
262
263 topStageView: {
264 get: function() {
265 return this._topStageView;
266 },
267 set: function(value) {
268 if(value) {
269 this.documentStageView = "top";
270 this.frontStageView = false;
271 this.sideStageView = false;
272 }
273
274 this._topStageView = value;
275 }
276 },
277
278 _sideStageView: {
279 value: false
280 },
281
282 sideStageView: {
283 get: function() {
284 return this._sideStageView;
285 },
286 set: function(value) {
287 if(value) {
288 this.documentStageView = "side";
289 this.frontStageView = false;
290 this.topStageView = false;
291 }
292
293 this._sideStageView = value;
294 }
295 },
296
297 _debug: { 128 _debug: {
298 value: true 129 value: true
299 }, 130 },
diff --git a/js/models/element-model.js b/js/models/element-model.js
index 07abbd40..7d8e6ebb 100755
--- a/js/models/element-model.js
+++ b/js/models/element-model.js
@@ -53,7 +53,7 @@ var modelGenerator = exports.modelGenerator = function() {
53 }) 53 })
54 }); 54 });
55 55
56 if(this._model.selection !== "body") { 56 if(this._model.selection !== "body" && this.nodeName.toLowerCase() !== "ninja-content") {
57 this._model.props3D.init(this, false); 57 this._model.props3D.init(this, false);
58 } 58 }
59 59
@@ -75,9 +75,9 @@ var getInfoForElement = function(el) {
75 } 75 }
76 76
77 if(el.nodeName.toLowerCase() === "ninja-content") { 77 if(el.nodeName.toLowerCase() === "ninja-content") {
78 elementName = "body"; 78 elementName = "div";
79 controller = elementNameToController(elementName); 79 controller = elementNameToController("body");
80 pi = elementNameToPi(elementName); 80 pi = elementNameToPi("body");
81 } 81 }
82 82
83 // TODO: Add this in case there is no controller for the component 83 // TODO: Add this in case there is no controller for the component
diff --git a/js/models/materials-model.js b/js/models/materials-model.js
index cc3c3fa1..ec481933 100755
--- a/js/models/materials-model.js
+++ b/js/models/materials-model.js
@@ -42,8 +42,8 @@ var RadialGradientMaterial = require("js/lib/rdge/materials/radial-gradient-mate
42var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial; 42var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial;
43var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial; 43var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial;
44//var CloudMaterial = require("js/lib/rdge/materials/cloud-material").CloudMaterial; 44//var CloudMaterial = require("js/lib/rdge/materials/cloud-material").CloudMaterial;
45//var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial; 45var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial;
46//var RaidersMaterial = require("js/lib/rdge/materials/radial-blur-material").RaidersMaterial; 46var DarkBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").DarkBlurMaterial;
47var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial; 47var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial;
48var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; 48var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial;
49//var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial; 49//var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial;
@@ -52,7 +52,7 @@ var FlagMaterial = require("js/lib/rdge/materials/flag-material").FlagMaterial;
52//var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial; 52//var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial;
53//var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial; 53//var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial;