define('application/components/modals/outofhome', [
'application/components/modals/error',
'rofl/lib/l10n',
'application/widgets/pointerfocusablebutton',
'rofl/widgets/label',
'antie/runtimecontext'
], function (
Abstract,
L10N,
Button,
Label,
RuntimeContext
) {
'use strict';
var l10n = L10N.getInstance(),
application = RuntimeContext.getCurrentApplication();
return Abstract.extend({
/**
* Initialises the modal.
*/
init: function init () {
init.base.call(this, {classNames: ['outofhome']});
},
/**
* BeforeShow event.
*
* @param {Object} e - The event data.
*/
onBeforeShow: function onBeforeShow (e) {
application.hideLoader();
e.args = {
title: l10n.get('outofhome.title'),
text: l10n.get('outofhome.subtitle'),
button: {
id: 'logout',
label: l10n.get('outofhome.button')
},
callback: function () {
application.route('username');
},
showGoBackButton: false
};
onBeforeShow.base.call(this, e);
},
/**
* Select event.
*/
_onSelect: function () {
application.route('username');
this.parentWidget.back();
}
});
});