Source: components/modals/version.js

define('application/components/modals/version', [
    'application/components/modals/abstract',
    'rofl/lib/utils',
    'antie/runtimecontext'
], function (
    Abstract,
    Utils,
    RuntimeContext
) {
    'use strict';
    var application = RuntimeContext.getCurrentApplication();

    return Abstract.extend({

        /**
         * Init function.
         */
        init: function init () {
            this._onBlurBound = Utils.bind(this.onBlur, this);

            init.base.call(this);
        },

        /**
         * AfterShow event.
         * Make sure the focus is always on the new version popup.
         */
        onAfterShow: function onAfterShow () {
            this.resetFocus();
        },

        /**
         * Reset the focus to the confirmation button.
         */
        resetFocus: function () {
            this._buttonsList.getChildWidgets()[0].removeFocus();
            application._focussedWidget = this._buttonsList.getChildWidgets()[0];
            this._buttonsList.getChildWidgets()[0].focus();
        },

        /**
         * Blur event.
         */
        onBlur: function () {
           this.resetFocus();
        }
    });
});