mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-01 22:57:41 -04:00
Documentation! + some little fixes to add consistency between components
This commit is contained in:
@@ -113,7 +113,7 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
utils.updateProperties(self.EVENTS, {writable: false});
|
||||
|
||||
/**
|
||||
* @returns {ClayItem}
|
||||
* @returns {Array.<ClayItem>}
|
||||
*/
|
||||
self.getAllItems = function() {
|
||||
_checkBuilt('getAllItems');
|
||||
@@ -121,21 +121,21 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} key
|
||||
* @param {string} appKey
|
||||
* @returns {ClayItem}
|
||||
*/
|
||||
self.getItemByAppKey = function(key) {
|
||||
self.getItemByAppKey = function(appKey) {
|
||||
_checkBuilt('getItemByAppKey');
|
||||
return _itemsByAppKey[key];
|
||||
return _itemsByAppKey[appKey];
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} key
|
||||
* @param {string} id
|
||||
* @returns {ClayItem}
|
||||
*/
|
||||
self.getItemById = function(key) {
|
||||
self.getItemById = function(id) {
|
||||
_checkBuilt('getItemById');
|
||||
return _itemsById[key];
|
||||
return _itemsById[id];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -181,6 +181,9 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
// prevent external modifications of properties
|
||||
utils.updateProperties(self, { writable: false, configurable: false });
|
||||
|
||||
// expose the config to allow developers to update it before the build is run
|
||||
self.config = config;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,7 +194,7 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
* @param {string|{}} component.manipulator - methods to attach to the component
|
||||
* @param {function} component.manipulator.set - set manipulator method
|
||||
* @param {function} component.manipulator.get - get manipulator method
|
||||
* @param {{}} component.defaults - template defaults
|
||||
* @param {{}} [component.defaults] - template defaults
|
||||
* @param {function} [component.initialize] - method to scaffold the component
|
||||
* @return {boolean} - Returns true if component was registered correctly
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ function ClayItem(config) {
|
||||
'Make sure to register it with ClayConfig.registerComponent()');
|
||||
}
|
||||
|
||||
var _templateData = _.extend({}, _component.defaults, config);
|
||||
var _templateData = _.extend({}, _component.defaults || {}, config);
|
||||
|
||||
/** @type {string|null} */
|
||||
self.id = config.id || null;
|
||||
|
||||
Reference in New Issue
Block a user