add radio component

This commit is contained in:
Keegan
2016-02-14 02:31:46 -08:00
parent f00b288a82
commit 71dd8ef1c3
12 changed files with 186 additions and 31 deletions
+11 -8
View File
@@ -53,22 +53,25 @@ function ClayConfig(settings, config, $rootContainer) {
$container.add($wrapper);
_addItems(item.items, $wrapper);
} else {
var clayItem = new ClayItem(item).initialize();
var _item = _.copyObj(item);
_item.clayId = _items.length;
if (item.id) {
_itemsById[item.id] = clayItem;
var clayItem = new ClayItem(_item).initialize();
if (_item.id) {
_itemsById[_item.id] = clayItem;
}
if (item.appKey) {
_itemsByAppKey[item.appKey] = clayItem;
if (_item.appKey) {
_itemsByAppKey[_item.appKey] = clayItem;
}
_items.push(clayItem);
// set the value of the item via the manipulator to ensure consistency
var value = typeof _settings[item.appKey] !== 'undefined' ?
_settings[item.appKey] :
(item.defaultValue || '');
var value = typeof _settings[_item.appKey] !== 'undefined' ?
_settings[_item.appKey] :
(_item.defaultValue || '');
clayItem.set(value);