Permalink
Browse files

Change BaseEvents to mix AttributeEvents and Base to mix AttributeExtras

The reduces dependencies of BaseEvents, but does introduce the fact that
mixing BaseEvents into BaseCore does not equal the functionality of
Base. This is because Base now explicitly mixes in AttributeExtras.
  • Loading branch information...
1 parent b346ca0 commit bfcf08c41bb5b60d3b3bd7984df08f93897ac937 @ericf committed Oct 10, 2012
Showing with 11 additions and 14 deletions.
  1. +4 −2 src/base/js/Base.js
  2. +2 −2 src/base/js/BaseCore.js
  3. +3 −6 src/base/js/BaseEvents.js
  4. +2 −4 src/base/meta/base.json
View
@@ -61,6 +61,7 @@
function Base() {
Y.BaseCore.apply(this, arguments);
Y.BaseEvents.apply(this, arguments);
+ Y.AttributeExtras.apply(this, arguments);
}
/**
@@ -72,7 +73,7 @@
* @static
* @private
*/
- Base._ATTR_CFG = Y.BaseCore._ATTR_CFG.concat(Y.BaseEvents._ATTR_CFG);
+ Base._ATTR_CFG = Y.BaseCore._ATTR_CFG.concat(Y.BaseEvents._ATTR_CFG);
/**
* The array of non-attribute configuration properties supported by this class.
@@ -89,7 +90,7 @@
* @static
* @private
*/
- Base._NON_ATTRS_CFG = Y.BaseCore._NON_ATTRS_CFG.concat(Y.BaseEvents._NON_ATTR_CFG);
+ Base._NON_ATTRS_CFG = Y.BaseCore._NON_ATTRS_CFG.concat(Y.BaseEvents._NON_ATTRS_CFG);
/**
* <p>
@@ -124,6 +125,7 @@
Base.ATTRS = Y.AttributeCore.protectAttrs(Y.BaseCore.ATTRS);
Y.mix(Base, Y.BaseCore, false, null, 1);
+ Y.mix(Base, Y.AttributeExtras, false, null, 1);
// Needs to be `true`, to overwrite methods from `BaseCore`.
Y.mix(Base, Y.BaseEvents, true, null, 1);
View
@@ -213,7 +213,7 @@
* @private
*/
_initAttribute: function() {
- AttributeCore.apply(this);
+ Y.AttributeCore.call(this);
},
/**
@@ -419,7 +419,7 @@
}
if (this._allowAdHocAttrs) {
- nonAttrsCfg = c._NON_ATTRS_CFG;
+ nonAttrsCfg = c._NON_ATTRS_CFG;
if (nonAttrsCfg) {
for (i = 0, l = nonAttrsCfg.length; i < l; i++) {
nonAttrs[nonAttrsCfg[i]] = true;
@@ -13,7 +13,6 @@
BUBBLETARGETS = "bubbleTargets",
_BUBBLETARGETS = "_bubbleTargets",
- Attribute = Y.Attribute,
AttributeEvents = Y.AttributeEvents;
/**
@@ -22,10 +21,7 @@
@class BaseEvents
@extensionfor BaseCore
- @uses Attribute
- @uses AttributeCore
@uses AttributeEvents
- @uses AttributeExtras
@uses EventTarget
@since 3.7.0
**/
@@ -43,7 +39,8 @@
* @private
*/
_initAttribute: function(cfg) {
- Attribute.call(this);
+ Y.BaseCore.prototype._initAttribute.apply(this, arguments);
+ Y.AttributeEvents.call(this);
this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;
this._yuievt.config.prefix = this._eventPrefix;
@@ -195,6 +192,6 @@
}
};
- Y.mix(BaseEvents, Attribute, false, null, 1);
+ Y.mix(BaseEvents, AttributeEvents, false, null, 1);
Y.BaseEvents = BaseEvents;
View
@@ -9,16 +9,14 @@
},
"base-events": {
"requires": [
- "attribute-base"
+ "attribute-events"
]
},
"base-base": {
"requires": [
+ "attribute-base",
"base-core",
"base-events"
- ],
- "after": [
- "attribute-complex"
]
},
"base-build": {

0 comments on commit bfcf08c

Please sign in to comment.