From 8247cddcc7ddce25a6282e97d304cad9a0f0c4f3 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:06:31 -0700 Subject: fixed the shape subtool not refreshing the icon Signed-off-by: Valerio Virgillito --- js/components/layout/tool-button.reel/tool-button.html | 4 ++++ js/components/layout/tool-button.reel/tool-button.js | 11 ----------- js/components/layout/tools-list.reel/tools-list.html | 12 ++---------- js/data/tools-data.js | 13 +++++++++++++ 4 files changed, 19 insertions(+), 21 deletions(-) (limited to 'js') 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 @@ "prototype": "js/components/layout/tool-button.reel", "properties": { "element": {"#": "toolBarButton"} + }, + "bindings": { + "selected": {"<<->": "@owner.data.selected"}, + "subselected": {"<-": "@owner.data.subtools.selected"} } } } 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, { this.element.addEventListener("mousedown", this, false); this.element.addEventListener("dblclick", this, false); - Object.defineBinding(this, "selected", { - boundObject: this.data, - boundObjectPropertyPath: "selected", - oneway: false - }); - if(this.data.container) { this.element.title = this.data.subtools[this._subselected].toolTip; - Object.defineBinding(this, "subselected", { - boundObject: this.data.subtools, - boundObjectPropertyPath: "selected", - oneway: true - }); } 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 @@ "element": {"#": "toolbutton"} }, "bindings": { - "data": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "data": {"<-": "@repetition1.objectAtCurrentIteration"} } }, @@ -30,11 +26,7 @@ "element": {"#": "groupLine"} }, "bindings": { - "condition": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup", - "oneway": true - } + "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"} } }, 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, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": true }, { @@ -71,6 +72,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -82,6 +84,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": true, "container": false, + "subtools": [], "selected": false }, { @@ -93,6 +96,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/cursors/Crosshair.png') 8 8, default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -104,6 +108,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -115,6 +120,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "text", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -163,6 +169,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/brush_down.png') 9 17, default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -174,6 +181,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/bucket_down.png'), default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -185,6 +193,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/inkbottle_cursor.png'), default", "lastInGroup": true, "container": false, + "subtools": [], "selected": false }, // { @@ -196,6 +205,7 @@ exports.ToolsData = Montage.create(Montage, { // "cursor": "auto", // "lastInGroup": false, // "container": false, +// "subtools": [], // "selected": false // }, { @@ -207,6 +217,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -218,6 +229,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/hand_down.png'), default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -229,6 +241,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/cursors/zoom.png'),default", "lastInGroup": true, "container": false, + "subtools": [], "selected": false } ] -- cgit v1.2.3