ComplexAttribute.js revision fdaf522f78615dc3145b1771f6f8daba2df06bb6
/**
* Adds support for attribute providers to handle complex attributes in the constructor
*
* @module attribute
* @submodule attribute-complex
* @for Attribute
*/
var O = Y.Object,
DOT = ".";
/**
* attributes can be keyed by the top level attribute name.
*
* @method _normAttrVals
*
* @return {Object} An object literal with 2 properties - "simple" and "complex",
* containing simple and complex attribute values respectively keyed
* by the top level attribute name, or null, if valueHash is falsey.
*
* @private
*/
_normAttrVals : function(valueHash) {
var vals = {},
subvals = {},
path,
attr,
v, k;
if (valueHash) {
for (k in valueHash) {
if (valueHash.hasOwnProperty(k)) {
v[v.length] = {
};
} else {
}
}
}
} else {
return null;
}
},
/**
* Returns the initial value of the given attribute from
* either the default configuration provided, or the
* over-ridden value if it exists in the set of initValues
* provided and the attribute is not read-only.
*
* @param {String} attr The name of the attribute
* @param {Object} cfg The attribute configuration object
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
*
* @return {Any} The initial value of the attribute.
*
* @method _getAttrInitVal
* @private
*/
i,
l,
path,
if (valFn) {
}
if (valFn) {
}
}
// Simple Attributes
}
// Complex Attributes (complex values applied, after simple, incase both are set)
}
}
}
return val;
}
};
// Consistency with the rest of the Attribute addons for now.