aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorhwc4872012-06-13 14:04:09 -0700
committerhwc4872012-06-13 14:04:09 -0700
commit3e481dd581e0305dd8b572ed0d17e86622223464 (patch)
treeaca2b28aa72857a52e047fb94090c34ab8dd1c2c /js/controllers
parenta7aa51e6b91623772eef54b827616432838b560e (diff)
parent682f4917d6badd105998c3dd84d031c38b51f017 (diff)
downloadninja-3e481dd581e0305dd8b572ed0d17e86622223464.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/elements/body-controller.js2
-rwxr-xr-xjs/controllers/selection-controller.js22
2 files changed, 5 insertions, 19 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js
index 0dc11b82..27989c65 100755
--- a/js/controllers/elements/body-controller.js
+++ b/js/controllers/elements/body-controller.js
@@ -37,7 +37,7 @@ exports.BodyController = Montage.create(ElementController, {
37 case "height": 37 case "height":
38 case "width": 38 case "width":
39 case "-webkit-transform-style": 39 case "-webkit-transform-style":
40 return this.application.ninja.stylesController.getElementStyle(el, p, true, true); 40 return this.application.ninja.stylesController.getElementStyle(el, p);
41 default: 41 default:
42 return ElementController.getProperty(el, p, true, true); 42 return ElementController.getProperty(el, p, true, true);
43 //console.log("Undefined Stage property ", p); 43 //console.log("Undefined Stage property ", p);
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 9ae1cfc9..b327bea4 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -35,11 +35,13 @@ exports.SelectionController = Montage.create(Component, {
35 35
36 if(this._currentDocument && this._currentDocument.currentView === "design") { 36 if(this._currentDocument && this._currentDocument.currentView === "design") {
37 this._currentDocument.model._selection = this.application.ninja.selectedElements; 37 this._currentDocument.model._selection = this.application.ninja.selectedElements;
38// this._currentDocument.model.selectionContainer = this.application.ninja._currentSelectedContainer;
39 } 38 }
40 39
41 this._currentDocument = value; 40 this._currentDocument = value;
42 41
42 if(this._currentDocument && this._currentDocument.currentView === "design") {
43 this.selectedElements = this._currentDocument.model.selection;
44 }
43 /* 45 /*
44 if(!value) { 46 if(!value) {
45 } else if(this._currentDocument.currentView === "design") { 47 } else if(this._currentDocument.currentView === "design") {
@@ -59,21 +61,17 @@ exports.SelectionController = Montage.create(Component, {
59 return this._selectedElements; 61 return this._selectedElements;
60 }, 62 },
61 set: function(value) { 63 set: function(value) {
62 if(this.currentDocument && this.currentDocument.currentView === "code") return;
63 64
64 if(value) { 65 if(value) {
65 this._selectedElements = value; 66 this._selectedElements = value;
66 67
67 this.application.ninja.selectedElements = this._selectedElements; 68 this.application.ninja.selectedElements = this._selectedElements;
68// this.application.ninja._currentSelectedContainer = this._selectionContainer = this.application.ninja.currentDocument.model.documentRoot;
69 69
70 if(this._selectedElements.length === 0) { 70 if(this._selectedElements.length === 0) {
71 this.executeSelectElement(); 71 this.executeSelectElement();
72 } else { 72 } else {
73 this.executeSelectElement(this._selectedElements); 73 this.executeSelectElement(this._selectedElements);
74 } 74 }
75
76
77 } 75 }
78 } 76 }
79 }, 77 },
@@ -84,18 +82,6 @@ exports.SelectionController = Montage.create(Component, {
84 this.eventManager.addEventListener("elementsRemoved", this, false); 82 this.eventManager.addEventListener("elementsRemoved", this, false);
85 this.eventManager.addEventListener("elementReplaced", this, false); 83 this.eventManager.addEventListener("elementReplaced", this, false);
86 this.eventManager.addEventListener("selectAll", this, false); 84 this.eventManager.addEventListener("selectAll", this, false);
87
88 this.addPropertyChangeListener("currentDocument.model.domContainer", this);
89 }
90 },
91
92 handleChange: {
93 value: function() {
94 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
95 if(this.currentDocument.model.getProperty("domContainer") !== null) {
96 this.executeSelectElement();
97 }
98 }
99 } 85 }
100 }, 86 },
101 87
@@ -125,7 +111,7 @@ exports.SelectionController = Montage.create(Component, {
125 value: function(event) { 111 value: function(event) {
126 var selected = [], childNodes = [], self = this; 112 var selected = [], childNodes = [], self = this;
127 113
128 childNodes = this.application.ninja.currentDocument.model.documentRoot.childNodes; 114 childNodes = this.currentDocument.model.domContainer.childNodes;
129 childNodes = Array.prototype.slice.call(childNodes, 0); 115 childNodes = Array.prototype.slice.call(childNodes, 0);
130 childNodes.forEach(function(item) { 116 childNodes.forEach(function(item) {
131 if(self.isNodeTraversable(item)) { 117 if(self.isNodeTraversable(item)) {