restructure directories and add tests for clay-item

This commit is contained in:
Keegan
2016-02-01 17:38:45 -08:00
parent bca1975d8e
commit c37012093a
23 changed files with 108 additions and 38 deletions
+3 -3
View File
@@ -40,13 +40,13 @@ function ClayConfig(settings, config, $rootContainer) {
self.EVENTS = {
/**
* Called before framework has initialized. This is when you would attach your
* custom items.
* custom components.
* @const
*/
BEFORE_BUILD: 'BEFORE_BUILD',
/**
* Called after the config has been parsed and all items have their initial value
* Called after the config has been parsed and all components have their initial value
* set
* @const
*/
@@ -130,7 +130,7 @@ function ClayConfig(settings, config, $rootContainer) {
$container.add($wrapper);
_addItems(item.items, $wrapper);
} else {
var clayItem = new ClayItem(item);
var clayItem = new ClayItem(item).initialize();
if (item.id) {
_itemsById[item.id] = clayItem;
+3 -5
View File
@@ -23,8 +23,8 @@ function ClayItem(config) {
/** @type {string|null} */
self.appKey = config.appKey || null;
/** @type {object|null} */
self.config = config || null;
/** @type {object} */
self.config = config;
/** @type {M} */
self.$element = HTML(_.formatHtml(_itemType.template, _templateData));
@@ -38,7 +38,7 @@ function ClayItem(config) {
}
/**
* Run the initializer. This will automatically be run on item creation.
* Run the initializer if it exists.
* @returns {ClayItem}
*/
self.initialize = function() {
@@ -56,8 +56,6 @@ function ClayItem(config) {
self[methodName] = method.bind(self);
});
self.initialize();
// prevent external modifications of properties
utils.updateProperties(self, { writable: false, configurable: false });
}