aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/component-controller.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/controllers/elements/component-controller.js
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/controllers/elements/component-controller.js')
-rwxr-xr-xjs/controllers/elements/component-controller.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js
index 83450d0f..260ee8a0 100755
--- a/js/controllers/elements/component-controller.js
+++ b/js/controllers/elements/component-controller.js
@@ -11,6 +11,8 @@ exports.ComponentController = Montage.create(ElementController, {
11 11
12 getProperty: { 12 getProperty: {
13 value: function(el, prop) { 13 value: function(el, prop) {
14 var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el);
15
14 switch(prop) { 16 switch(prop) {
15 case "id": 17 case "id":
16 case "class": 18 case "class":
@@ -19,18 +21,20 @@ exports.ComponentController = Montage.create(ElementController, {
19 case "width": 21 case "width":
20 case "height": 22 case "height":
21 if(el.nodeName === "IMG" && (prop === "width" || prop === "height")) { 23 if(el.nodeName === "IMG" && (prop === "width" || prop === "height")) {
22 return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; 24 return component[prop];
23 } else { 25 } else {
24 return ElementController.getProperty(el, prop, true); 26 return ElementController.getProperty(el, prop, true);
25 } 27 }
26 default: 28 default:
27 return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; 29 return component[prop];
28 } 30 }
29 } 31 }
30 }, 32 },
31 33
32 setProperty: { 34 setProperty: {
33 value: function(el, p, value) { 35 value: function(el, p, value) {
36 var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el);
37
34 switch(p) { 38 switch(p) {
35 case "id": 39 case "id":
36 case "class": 40 case "class":
@@ -39,15 +43,14 @@ exports.ComponentController = Montage.create(ElementController, {
39 case "width": 43 case "width":
40 case "height": 44 case "height":
41 if(el.nodeName === "IMG" && (p === "width" || p === "height")) { 45 if(el.nodeName === "IMG" && (p === "width" || p === "height")) {
42 this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; 46 component[p] = value;
43 } else { 47 } else {
44 ElementController.setProperty(el, p, value); 48 ElementController.setProperty(el, p, value);
45 } 49 }
46 break; 50 break;
47 default: 51 default:
48 if(p === "min" || p === "max") value = parseFloat(value); 52 if(p === "min" || p === "max") value = parseFloat(value);
49 53 component[p] = value;
50 this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value;
51 break; 54 break;
52 55
53 } 56 }