Moves login state of dialog to be first, to be the initial state.

By default impromptu uses the first state as the default one to show.
This commit is contained in:
damencho 2017-10-30 12:17:12 -05:00 committed by Дамян Минков
parent 561d1909ca
commit fda52f7160
1 changed files with 23 additions and 23 deletions

View File

@ -62,29 +62,6 @@ function LoginDialog(successCallback, cancelCallback) {
}
const states = {
connecting: {
buttons: [],
defaultButton: 0,
html: '<div id="connectionStatus"></div>',
titleKey: 'dialog.connecting'
},
finished: {
buttons: finishedButtons,
defaultButton: 0,
html: '<div id="errorMessage"></div>',
titleKey: 'dialog.error',
submit(e, v) {
e.preventDefault();
if (v === 'retry') {
// eslint-disable-next-line no-use-before-define
connDialog.goToState('login');
} else {
// User cancelled
cancelCallback();
}
}
},
login: {
buttons: loginButtons,
focus: ':input:first',
@ -107,6 +84,29 @@ function LoginDialog(successCallback, cancelCallback) {
cancelCallback();
}
}
},
connecting: {
buttons: [],
defaultButton: 0,
html: '<div id="connectionStatus"></div>',
titleKey: 'dialog.connecting'
},
finished: {
buttons: finishedButtons,
defaultButton: 0,
html: '<div id="errorMessage"></div>',
titleKey: 'dialog.error',
submit(e, v) {
e.preventDefault();
if (v === 'retry') {
// eslint-disable-next-line no-use-before-define
connDialog.goToState('login');
} else {
// User cancelled
cancelCallback();
}
}
}
};
const connDialog = APP.UI.messageHandler.openDialogWithStates(