Improve component type guessing.

This commit is contained in:
Jürg Lehni 2012-11-14 18:34:27 -08:00
parent 532a94369e
commit 61c37f0858

View file

@ -59,12 +59,13 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
},
initialize: function(obj) {
this._type = obj.type
|| ('options' in obj
this._type = obj.type in this._types
? obj.type
: 'options' in obj
? 'list'
: 'onClick' in obj
? 'button'
: typeof value);
: typeof obj.value;
this._info = this._types[this._type] || { type: this._type };
var that = this,
fireChange = false;