button-core.js revision 24af57b8ae16a109f012057cf02c11258b6d8b4d
/**
* Provides an interface for working with button-like DOM nodes
*
* @module button-core
* @since 3.5.0
*/
/**
* returns a properly formed yui class name
*
* @method
* @param str {String} string to be appended at the end of class name
* @return
* @private
*/
function makeClassName(str) {
if (str) {
} else {
}
}
/**
* Creates a button
*
* @class Button
* @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
* @param config {Object} Config object.
* @private
*/
} else {
}
},
/**
* @method _initAttributes
* @description
* @param config {Object} Config object.
* @private
*/
_initAttributes: function(config) {
config.label = config.label || config.host.getContent() || config.host.get('value'); //Todo: Is this the right place?
},
/**
* @method renderUI
* @private
*/
// Set some default node attributes
},
/**
* @method enable
* @description
* @public
*/
enable: function() {
this.set('disabled', false);
},
/**
* @method disable
* @description
* @public
*/
disable: function() {
this.set('disabled', true);
},
/**
* @method getNode
* @description
* @public
*/
getNode: function() {
return this._host;
},
/**
* @method _uiSetLabel
* @description
* @private
*/
_uiSetLabel: function(value) {
return value;
},
/**
* @method _uiSetDisabled
* @description
* @private
*/
_uiSetDisabled: function(value) {
return value;
},
/**
* @method _uiGetLabel
* @description
* @private
*/
_uiGetLabel: function() {
return value;
}
};
/**
* Attribute configuration.
*
* @property ATTRS
* @type {Object}
* @private
* @static
*/
label: {
setter: '_uiSetLabel',
getter: '_uiGetLabel',
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 the Button DOM objects
*
* @property CLASS_NAMES
* @type {Array}
* @static
*/
Button.CLASS_NAMES = {
BUTTON : makeClassName(),
};
// Export Button
Y.ButtonCore = Button;