From 3a8875c288049b466bfeb8b7f0510fd8cbfb970d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 13:30:08 -0800 Subject: Supporting switching materials in the PI. Also, moved makeFillMaterial and makeStrokeMaterial functions into GLGeomObj so shapes other than GLRectangle can use these routines. Signed-off-by: Nivesh Rajbhandari --- js/components/combobox.reel/combobox.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/components/combobox.reel') diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index ebbfbffa..3200b01c 100644 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js @@ -174,6 +174,22 @@ exports.Combobox = Montage.create(Component, { prepareForDraw: { value: function() { + if( (this._value === null) && this._items.length ) + { + var current = this._items[0]; + if(this.dataFunction) + { + this.value = this.dataFunction(current); + } + else if(this.dataField) + { + this.value = current[this.dataField]; + } + else + { + this.value = current; + } + } this.element.addEventListener("change", this, false); } } -- cgit v1.2.3