button-core-debug.js revision a504e2ec9011689b5767651880ff46b5375b1921
/**
* Provides an interface for working with button-like DOM nodes
*
* @module button-core
* @since 3.5.0
*/
/**
* Creates a button
*
* @class ButtonCore
* @param config {Object} Configuration object
* @constructor
*/
this.initializer(config);
}
TEMPLATE: '<button/>',
/**
* @method initializer
* @description Internal init() handler.
* @param config {Object} Config object.
* @private
*/
initializer: function(config) {
this._initAttributes(config);
},
/**
* @method _initNode
* @description Node initializer
* @param config {Object} Config object.
* @private
*/
} else {
}
},
/**
* @method _initAttributes
* @description Attribute initializer
* @param config {Object} Config object.
* @private
*/
_initAttributes: function(config) {
},
/**
* @method renderUI
* @param config {Object} Config object.
* @private
*/
// Set some default node attributes
}
},
/**
* @method enable
* @description Sets the button's `disabled` DOM attribute to false
* @public
*/
enable: function() {
this.set('disabled', false);
},
/**
* @method disable
* @description Sets the button's `disabled` DOM attribute to true
* @public
*/
disable: function() {
this.set('disabled', true);
},
/**
* @method getNode
* @description Gets the host node for this button instance
* @public
*/
getNode: function() {
return this._host;
},
/**
* @method _getLabel
* @description Getter for a button's 'label' ATTR
* @private
*/
_getLabel: function () {
if (tagName === 'input') {
}
else {
}
return label;
},
/**
* @method _uiSetLabel
* @description Setter for a button's 'label' ATTR
* @param label {string}
* @private
*/
_uiSetLabel: function (label) {
if (tagName === 'input') {
} else {
}
return label;
},
/**
* @method _uiSetDisabled
* @description Setter for the 'disabled' ATTR
* @param value {boolean}
* @private
*/
_uiSetDisabled: function(value) {
return value;
}
};
/**
* Attribute configuration.
*
* @property ATTRS
* @type {Object}
* @private
* @static
*/
label: {
setter: '_uiSetLabel',
getter: '_getLabel',
lazyAdd: false
},
disabled: {
value: false,
setter: '_uiSetDisabled',
lazyAdd: false
}
};
/**
* Name of this component.
*
* @property NAME
* @type String
* @static
*/
/**
* Array of static constants used to identify the classnames applied to DOM nodes
*
* @property CLASS_NAMES
* @type {Object}
* @public
* @static
*/
Button.CLASS_NAMES = {
};
/**
* Array of static constants used to for applying ARIA states
*
* @property CLASS_NAMES
* @type {Object}
* @private
* @static
*/
Button.ARIA_STATES = {
PRESSED : 'aria-pressed',
CHECKED : 'aria-checked'
};
/**
* Array of static constants used to for applying ARIA roles
*
* @property CLASS_NAMES
* @type {Object}
* @private
* @static
*/
Button.ARIA_ROLES = {
BUTTON : 'button',
CHECKBOX: 'checkbox',
TOGGLE : 'toggle'
};
// Export Button
Y.ButtonCore = Button;