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 --- js/components/combobox.reel/combobox.js | 22 ++++++++- .../fill-properties.reel/fill-properties.html | 11 ++++- .../fill-properties.reel/fill-properties.js | 6 ++- .../ink-bottle-properties.html | 12 ++++- .../ink-bottle-properties.js | 6 ++- .../line-properties.reel/line-properties.js | 14 ++++-- .../oval-properties.reel/oval-properties.js | 14 ++++-- .../rect-properties.reel/rect-properties.js | 14 ++++-- .../shape-properties.reel/shape-properties.css | 6 +-- .../shape-properties.reel/shape-properties.html | 35 +++++++++----- .../shape-properties.reel/shape-properties.js | 53 +++++++++++++--------- 11 files changed, 137 insertions(+), 56 deletions(-) (limited to 'js/components') diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index deef2a47..8906a649 100644 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js @@ -27,6 +27,14 @@ exports.Combobox = Montage.create(Component, { value: null }, + dataField: { + value: null + }, + + dataFunction: { + value: null + }, + _items: { value: [] }, @@ -122,7 +130,19 @@ exports.Combobox = Montage.create(Component, { { var current = items[i]; optionItem = document.createElement("option"); - optionItem.value = current; + if(this.dataFunction) + { + optionItem.value = this.dataFunction(current); + } + else if(this.dataField) + { + optionItem.value = current[this.dataField]; + } + else + { + optionItem.value = current; + } + if(this.labelFunction) { optionItem.innerText = this.labelFunction(current); diff --git a/js/components/tools-properties/fill-properties.reel/fill-properties.html b/js/components/tools-properties/fill-properties.reel/fill-properties.html index d09b7f44..a35f9b15 100644 --- a/js/components/tools-properties/fill-properties.reel/fill-properties.html +++ b/js/components/tools-properties/fill-properties.reel/fill-properties.html @@ -11,6 +11,15 @@