aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-18 01:06:31 -0700
committerValerio Virgillito2012-05-18 01:06:31 -0700
commit8247cddcc7ddce25a6282e97d304cad9a0f0c4f3 (patch)
treef91eba9aec8515b4110af3632d558732521cc468 /js
parent084bb924bc3c3a6ad1e2e21099399bba4d473fed (diff)
downloadninja-8247cddcc7ddce25a6282e97d304cad9a0f0c4f3.tar.gz
fixed the shape subtool not refreshing the icon
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.html4
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.js11
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.html12
-rwxr-xr-xjs/data/tools-data.js13
4 files changed, 19 insertions, 21 deletions
diff --git a/js/components/layout/tool-button.reel/tool-button.html b/js/components/layout/tool-button.reel/tool-button.html
index 84a6d34e..a329f646 100755
--- a/js/components/layout/tool-button.reel/tool-button.html
+++ b/js/components/layout/tool-button.reel/tool-button.html
@@ -16,6 +16,10 @@
16 "prototype": "js/components/layout/tool-button.reel", 16 "prototype": "js/components/layout/tool-button.reel",
17 "properties": { 17 "properties": {
18 "element": {"#": "toolBarButton"} 18 "element": {"#": "toolBarButton"}
19 },
20 "bindings": {
21 "selected": {"<<->": "@owner.data.selected"},
22 "subselected": {"<-": "@owner.data.subtools.selected"}
19 } 23 }
20 } 24 }
21 } 25 }
diff --git a/js/components/layout/tool-button.reel/tool-button.js b/js/components/layout/tool-button.reel/tool-button.js
index 6cea0dc3..6008c4ec 100755
--- a/js/components/layout/tool-button.reel/tool-button.js
+++ b/js/components/layout/tool-button.reel/tool-button.js
@@ -48,19 +48,8 @@ exports.ToolButton = Montage.create(Component, {
48 this.element.addEventListener("mousedown", this, false); 48 this.element.addEventListener("mousedown", this, false);
49 this.element.addEventListener("dblclick", this, false); 49 this.element.addEventListener("dblclick", this, false);
50 50
51 Object.defineBinding(this, "selected", {
52 boundObject: this.data,
53 boundObjectPropertyPath: "selected",
54 oneway: false
55 });
56
57 if(this.data.container) { 51 if(this.data.container) {
58 this.element.title = this.data.subtools[this._subselected].toolTip; 52 this.element.title = this.data.subtools[this._subselected].toolTip;
59 Object.defineBinding(this, "subselected", {
60 boundObject: this.data.subtools,
61 boundObjectPropertyPath: "selected",
62 oneway: true
63 });
64 } 53 }
65 54
66 this.element.classList.add(this.data.id) 55 this.element.classList.add(this.data.id)
diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html
index d5c33624..df603bf8 100755
--- a/js/components/layout/tools-list.reel/tools-list.html
+++ b/js/components/layout/tools-list.reel/tools-list.html
@@ -16,11 +16,7 @@
16 "element": {"#": "toolbutton"} 16 "element": {"#": "toolbutton"}
17 }, 17 },
18 "bindings": { 18 "bindings": {
19 "data": { 19 "data": {"<-": "@repetition1.objectAtCurrentIteration"}
20 "boundObject": {"@": "repetition1"},
21 "boundObjectPropertyPath": "objectAtCurrentIteration",
22 "oneway": true
23 }
24 } 20 }
25 }, 21 },
26 22
@@ -30,11 +26,7 @@
30 "element": {"#": "groupLine"} 26 "element": {"#": "groupLine"}
31 }, 27 },
32 "bindings": { 28 "bindings": {
33 "condition": { 29 "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"}
34 "boundObject": {"@": "repetition1"},
35 "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup",
36 "oneway": true
37 }
38 } 30 }
39 }, 31 },
40 32
diff --git a/js/data/tools-data.js b/js/data/tools-data.js
index 32eaf24d..05455efe 100755
--- a/js/data/tools-data.js
+++ b/js/data/tools-data.js
@@ -60,6 +60,7 @@ exports.ToolsData = Montage.create(Montage, {
60 "cursor": "auto", 60 "cursor": "auto",
61 "lastInGroup": false, 61 "lastInGroup": false,
62 "container": false, 62 "container": false,
63 "subtools": [],
63 "selected": true 64 "selected": true
64 }, 65 },
65 { 66 {
@@ -71,6 +72,7 @@ exports.ToolsData = Montage.create(Montage, {
71 "cursor": "auto", 72 "cursor": "auto",
72 "lastInGroup": false, 73 "lastInGroup": false,
73 "container": false, 74 "container": false,
75 "subtools": [],
74 "selected": false 76 "selected": false
75 }, 77 },
76 { 78 {
@@ -82,6 +84,7 @@ exports.ToolsData = Montage.create(Montage, {
82 "cursor": "auto", 84 "cursor": "auto",
83 "lastInGroup": true, 85 "lastInGroup": true,
84 "container": false, 86 "container": false,
87 "subtools": [],
85 "selected": false 88 "selected": false
86 }, 89 },
87 { 90 {
@@ -93,6 +96,7 @@ exports.ToolsData = Montage.create(Montage, {
93 "cursor": "url('images/cursors/Crosshair.png') 8 8, default", 96 "cursor": "url('images/cursors/Crosshair.png') 8 8, default",
94 "lastInGroup": false, 97 "lastInGroup": false,
95 "container": false, 98 "container": false,
99 "subtools": [],
96 "selected": false 100 "selected": false
97 }, 101 },
98 { 102 {
@@ -104,6 +108,7 @@ exports.ToolsData = Montage.create(Montage, {
104 "cursor": "auto", 108 "cursor": "auto",
105 "lastInGroup": false, 109 "lastInGroup": false,
106 "container": false, 110 "container": false,
111 "subtools": [],
107 "selected": false 112 "selected": false
108 }, 113 },
109 { 114 {
@@ -115,6 +120,7 @@ exports.ToolsData = Montage.create(Montage, {
115 "cursor": "text", 120 "cursor": "text",
116 "lastInGroup": false, 121 "lastInGroup": false,
117 "container": false, 122 "container": false,
123 "subtools": [],
118 "selected": false 124 "selected": false
119 }, 125 },
120 { 126 {
@@ -163,6 +169,7 @@ exports.ToolsData = Montage.create(Montage, {
163 "cursor": "url('images/tools/brush_down.png') 9 17, default", 169 "cursor": "url('images/tools/brush_down.png') 9 17, default",
164 "lastInGroup": false, 170 "lastInGroup": false,
165 "container": false, 171 "container": false,
172 "subtools": [],
166 "selected": false 173 "selected": false
167 }, 174 },
168 { 175 {
@@ -174,6 +181,7 @@ exports.ToolsData = Montage.create(Montage, {
174 "cursor": "url('images/tools/bucket_down.png'), default", 181 "cursor": "url('images/tools/bucket_down.png'), default",
175 "lastInGroup": false, 182 "lastInGroup": false,
176 "container": false, 183 "container": false,
184 "subtools": [],
177 "selected": false 185 "selected": false
178 }, 186 },
179 { 187 {
@@ -185,6 +193,7 @@ exports.ToolsData = Montage.create(Montage, {
185 "cursor": "url('images/tools/inkbottle_cursor.png'), default", 193 "cursor": "url('images/tools/inkbottle_cursor.png'), default",
186 "lastInGroup": true, 194 "lastInGroup": true,
187 "container": false, 195 "container": false,
196 "subtools": [],
188 "selected": false 197 "selected": false
189 }, 198 },
190// { 199// {
@@ -196,6 +205,7 @@ exports.ToolsData = Montage.create(Montage, {
196// "cursor": "auto", 205// "cursor": "auto",
197// "lastInGroup": false, 206// "lastInGroup": false,
198// "container": false, 207// "container": false,
208// "subtools": [],
199// "selected": false 209// "selected": false
200// }, 210// },
201 { 211 {
@@ -207,6 +217,7 @@ exports.ToolsData = Montage.create(Montage, {
207 "cursor": "auto", 217 "cursor": "auto",
208 "lastInGroup": false, 218 "lastInGroup": false,
209 "container": false, 219 "container": false,
220 "subtools": [],
210 "selected": false 221 "selected": false
211 }, 222 },
212 { 223 {
@@ -218,6 +229,7 @@ exports.ToolsData = Montage.create(Montage, {
218 "cursor": "url('images/tools/hand_down.png'), default", 229 "cursor": "url('images/tools/hand_down.png'), default",
219 "lastInGroup": false, 230 "lastInGroup": false,
220 "container": false, 231 "container": false,
232 "subtools": [],
221 "selected": false 233 "selected": false
222 }, 234 },
223 { 235 {
@@ -229,6 +241,7 @@ exports.ToolsData = Montage.create(Montage, {
229 "cursor": "url('images/cursors/zoom.png'),default", 241 "cursor": "url('images/cursors/zoom.png'),default",
230 "lastInGroup": true, 242 "lastInGroup": true,
231 "container": false, 243 "container": false,
244 "subtools": [],
232 "selected": false 245 "selected": false
233 } 246 }
234 ] 247 ]