define('application/widgets/player/buttons/nownext', [
'application/widgets/pointerfocusablebutton',
'rofl/widgets/label',
'rofl/lib/l10n'
], function (
Button,
Label,
L10n
) {
'use strict';
var NOW_NEXT_CLASS = 'icon-guide',
NOW_NEXT_CHEVRON_CLASS = 'icon-chevron-down',
l10n = L10n.getInstance(),
NowNextButton;
NowNextButton = Button.extend({
/**
* Initialises the widget.
*
* @param {string} id - The id.
*/
init: function init (id) {
init.base.call(this, id);
this.addClass(['control', 'now-next']);
this._build();
},
/**
* Builds the widget.
*
* @private
*/
_build: function () {
var icon = this._icon = new Label({ text: '', classNames: ['v-align-target', 'icon', NOW_NEXT_CLASS] }),
helper = new Label({ text: '', classNames: ['v-align-helper'] }),
nowNextText = new Label({ text: l10n.get('player.buttons.nowAndNext'), classNames: ['now-next-text', 'v-align-helper'] }),
nowNextChevronIcon = new Label({ text: '', classNames: ['v-align-target', 'icon', NOW_NEXT_CHEVRON_CLASS] });
this.appendChildWidget(helper);
this.appendChildWidget(icon);
this.appendChildWidget(nowNextText);
this.appendChildWidget(nowNextChevronIcon);
}
});
return NowNextButton;
});