From 329a859e2666716c3a1d99c6bd2679e10c81fc8d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 15:25:11 -0800 Subject: Added ability to toggle combobox's visibility so we can show/hide materials comboboxes in the tool options. Signed-off-by: Nivesh Rajbhandari --- js/components/combobox.reel/combobox.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'js/components/combobox.reel') diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js index 3200b01c..bc433f52 100644 --- a/js/components/combobox.reel/combobox.js +++ b/js/components/combobox.reel/combobox.js @@ -104,6 +104,26 @@ exports.Combobox = Montage.create(Component, { } }, + _visible: { + enumerable: false, + value: true + }, + + visible: { + enumerable: true, + serializable: true, + get: function() { + return this._visible; + }, + set: function(value) { + if(value !== this._visible) + { + this._visible = value; + this.needsDraw = true; + } + } + }, + handleChange: { value:function(event) @@ -158,6 +178,14 @@ exports.Combobox = Montage.create(Component, { this.element.appendChild(optionItem); } this.element.disabled = !this._enabled; + if(this._visible) + { + this.element.style.visibility = "visible"; + } + else + { + this.element.style.visibility = "hidden"; + } } } }, -- cgit v1.2.3