define('application/widgets/replay/filterbutton', [
'application/widgets/pointerfocusablebutton',
'rofl/widgets/label'
], function (
Button,
Label
) {
'use strict';
return Button.extend({
/**
* Initialises the button.
*
* @param {string} text - The button text.
* @param {string} [id] - The id. Optional.
*/
init: function init (text, id) {
init.base.call(this, id);
this.addClass('filter-button');
this._build(text);
},
/**
* Builds the widget.
*
* @param {string} text - The text to set.
* @private
*/
_build: function (text) {
this._buildLabel(text);
},
/**
* Builds the label.
*
* @param {string} text - The text to set.
* @private
*/
_buildLabel: function (text) {
var label = new Label({ text: text || '' });
this.appendChildWidget(label);
}
});
});