group.js revision b2e3e4e5b9ad601bb552e859ade3329168457dd6
/**
* A Widget to create groups of buttons
*
* @module button-group
* @since 3.5.0
*/
var BOUNDING_BOX = "boundingBox",
CONTENT_BOX = "contentBox",
SELECTOR = "button, input[type=button]",
CLICK_EVENT = "click",
/**
* Creates a ButtonGroup
*
* @class ButtonGroup
* @extends Widget
* @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? Then remove
},
/**
* renderUI implementation
*
* Creates a visual representation of the widget based on existing parameters.
* @method renderUI
*/
renderUI: function() {
var buttonNodes = this.getButtons();
});
},
/**
* bindUI implementation
*
* Hooks up events for the widget
* @method bindUI
*/
bindUI: function() {
var group = this,
},
/**
* @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 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
* @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 used in the ButtonGroup's DOM
*
* @property CLASS_NAMES
* @type Object
* @static
*/
});