group.js revision efa2177e01a423054231b00ca0e3c518e7ec79b9
/**
* Allows Y.Button instances to be grouped together
*
* @module buttongroup
* @main ButtonGroup
* @since 3.5.0
*/
var BOUNDING_BOX = "boundingBox",
CONTENT_BOX = "contentBox",
BUTTON_CLASS = "yui3-button",
SELECTOR = "button, input[type=button]",
CLICK_EVENT = "click";
/**
* Creates a ButtonGroup
*
* @class ButtonGroup
* @extends Base
* @param config {Object} Configuration object
* @constructor
*/
function ButtonGroup() {
}
/* ButtonGroup extends Widget */
/**
* @method initializer
* @description Internal init() handler.
* @param config {Object} Config object.
* @private
*/
initializer: function(){
// TODO: Nothing?
},
renderUI: function() {
var buttonNodes = this.getButtons();
new ButtonFactory(node);
});
},
bindUI: function() {
},
handleClick: function(e){
var bg = this;
if (type === 'push') {
// TODO: Nothing? Then why have a push group.
}
else if (type === 'checkbox') {
}
else if (type === 'radio') {
}
e.stopPropogation(); // Todo: Maybe?
},
/**
* @method getButtons
* @description Returns all Y.Buttons instances assigned to this group
* @public
*/
getButtons: function() {
},
/**
* @method getSelectedButtons
* @description Returns all Y.Buttons instances that are selected
* @public
*/
getSelectedButtons: function() {
var buttons = this.getButtons();
var selected = [];
}
});
return selected;
},
/**
* @method getSelectedValues
* @description Returns the values of all Y.Button instances that are selected
* @public
*/
getSelectedValues: function() {
var selected = this.getSelectedButtons();
var values = [];
}
});
return values;
}
}, {
// Y.ScrollView static properties
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'buttongroup'
* @readOnly
* @protected
* @static
*/
NAME: 'buttongroup',
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
type: {
writeOnce: 'initOnly',
value: 'radio'
}
}
});