Source: widgets/uibuilder/watchall.js

define('application/widgets/uibuilder/watchall', [
    'rofl/widgets/container',
    'rofl/widgets/label',
    'application/widgets/pointerfocusablebutton',
    'rofl/lib/l10n'
], function (
    Container,
    Label,
    Button,
    L10N
) {
    'use strict';

    var l10n = L10N.getInstance(),
        ICON_CLASS = 'icon-chevron-right';

    return Button.extend({

        /**
         * Initialises the watch all button.
         *
         * @param {Object} data - The event data.
         * @param {Object} watchallParams - Watchall widget params.
         */
        init: function init (data, watchallParams) {
            var icon = new Label(''),
                text = new Label(l10n.get('watchall')),
                container = new Container(),
                iconContainer = new Container(),
                classNames = watchallParams && watchallParams.classNames.concat('watchall') || 'watchall';

            init.base.call(this);

            if (data) {
                this.setDataItem(data);
            }

            iconContainer.addClass('icon-wrapper');
            iconContainer.appendChildWidget(icon);
            icon.addClass(['icon', ICON_CLASS]);
            text.addClass('text');
            container.addClass('wrapper');

            this.appendChildWidget(container);
            this.addClass(classNames);
            container.appendChildWidget(iconContainer);
            container.appendChildWidget(text);
        }
    });
});