group.js revision cceccdb28016ec7a8589d981db1237c1f72c6f93
/**
* A Widget to create groups of buttons
*
* @module button-group
* @since 3.5.0
*/
var CONTENT_BOX = "contentBox",
SELECTOR = "button, input[type=button], input[type=reset], input[type=submit]",
CLICK_EVENT = "click",
/**
* Creates a ButtonGroup
*
* @class ButtonGroup
* @extends Widget
* @param config {Object} Configuration object
* @constructor
*/
function ButtonGroup() {
}
/* ButtonGroup extends Widget */
/**
* @method renderUI
* @description Creates a visual representation of the widget based on existing parameters.
* @public
*/
renderUI: function() {
},
/**
* @method bindUI
* @description Hooks up events for the widget
* @public
*/
bindUI: function() {
var group = this,
},
/**
* @method getButtons
* @description Returns all buttons inside this this button group
* @public
*/
getButtons: function() {
},
/**
* @method getSelectedButtons
* @description Returns all Y.Buttons instances that are selected
* @public
*/
getSelectedButtons: function() {
var group = this,
selected = [],
}
});
return selected;
},
/**
* @method getSelectedValues
* @description Returns the values of all Y.Button instances that are selected
* @public
*/
getSelectedValues: function() {
var group = this,
values = [],
}
});
return values;
},
/**
* @method _handleClick
* @description A delegated click handler for when any button is clicked in the content box
* @param e {Object} An event object
* @private
*/
_handleClick: function(e){
var buttons,
clickedNode = e.target,
group = this,
// TODO: Anything for 'push' groups?
if (type === 'checkbox') {
}
else if (type === 'radio') {
if (!isSelected) {
}
}
}
}, {
// Y.ButtonGroup 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'
}
},
/**
* List of class names to use for ButtonGroups
*
* @property CLASS_NAMES
* @type {Object}
* @static
*/
});