From 486842239c71e7964f38a09aacda4970f2a82e1a Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 10:58:14 -0800 Subject: Updated tools and PI to get/set materials by binding to appModel's materials property. This requires us to add FlatMaterial to the list of materials in the MaterialsLibrary. Signed-off-by: Nivesh Rajbhandari --- .../ink-bottle-properties.reel/ink-bottle-properties.html | 12 +++++++++++- .../ink-bottle-properties.reel/ink-bottle-properties.js | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'js/components/tools-properties/ink-bottle-properties.reel') diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html index b98a7b4c..1602e793 100644 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html @@ -36,6 +36,16 @@ } }, + "_strokeMaterialCB": { + "module": "js/components/combobox.reel", + "name": "Combobox", + "properties": { + "element": {"#": "strokeMaterialIBCB"}, + "labelField": "_name", + "dataField": "_name" + } + }, + "owner": { "module": "js/components/tools-properties/ink-bottle-properties.reel", "name": "InkBottleProperties", @@ -49,7 +59,7 @@ "_useWebGL": {"#": "useWebGLCHIB"}, "_materialsContainer": {"#": "materialsContainerIB"}, - "_strokeMaterial": {"#": "strokeMaterialIBCB"} + "_strokeMaterial": {"@": "_strokeMaterialCB"} } } } diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js index 61ea808a..e3ffc359 100644 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js @@ -14,7 +14,11 @@ exports.InkBottleProperties = Montage.create(ToolProperties, { _subPrepare: { value: function() { - ShapesController.DisplayMaterials(this._strokeMaterial); + Object.defineBinding(this._strokeMaterial, "items", { + boundObject: this.application.ninja.appModel, + boundObjectPropertyPath: "materials", + oneway: false + }); this.handleChange(null); this._useWebGL.addEventListener("change", this, false); -- cgit v1.2.3