define('application/widgets/detail/buttons/play', [
'application/widgets/detail/iconbutton',
'rofl/lib/l10n'
], function (
IconButton,
L10N
) {
'use strict';
var l10n = L10N.getInstance(),
config = {
id: 'playnow',
text: l10n.get('details.buttonslist.playnow'),
classes: ['icon']
};
return IconButton.extend({
init: function init () {
init.base.call(this, config.id, config.text, config.classes);
this.setIcon('icon-play-v2');
},
/**
* Sets text on button.
*
* @param {string} text - Text.
*/
setText: function (text) {
this._label.setText(text);
},
/**
* Sets icon on button.
*
* @param {string} icon - Icon.
*/
setIcon: function (icon) {
this._icon.addClass(icon);
if (this._iconClass && icon !== this._iconClass) {
this._icon.removeClass(this._iconClass);
}
this._iconClass = icon;
}
});
});