Skip to content

Commit

Permalink
Include new loginForm
Browse files Browse the repository at this point in the history
  • Loading branch information
ylavoie committed Jun 19, 2020
1 parent b713609 commit 50e840b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions UI/js-src/lsmb/loginForm.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/** @format */

require([
define([
"dojo/_base/declare",
"dojo/request/xhr",
"dojo/dom",
"dojo/dom-style",
"dojo/json",
"dijit/form/Form",
"dijit/Dialog",
"dijit/ProgressBar"
], function (xhr, dom, domStyle, json, dialog, progressBar) {
], function (declare, xhr, dom, domStyle, json, Form, dialog, progressBar) {
// Make indicator visible
function showIndicator() {
domStyle.set(dom.byId("login-indicator"), "visibility", "visible");
Expand Down Expand Up @@ -77,19 +79,16 @@ require([
indicator.startup();
}

// Submit form and show a 10 seconds progress bar
function submitForm() {
showIndicator();
window.setTimeout(showIndicator, 0);
window.setTimeout(sendForm, 10);
return false;
}

window.addEventListener(
'load',
function () {
setIndicator();
// Make it public
window.submitForm = submitForm;
});
return declare("lsmb/loginForm", [Form], {
startup: function () {
this.inherited(arguments);
setIndicator();
},
onSubmit: function () {
showIndicator();
window.setTimeout(showIndicator, 0);
window.setTimeout(sendForm, 10);
return false;
}
});
});
2 changes: 1 addition & 1 deletion UI/js-src/lsmb/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ define([
"lsmb/InvoiceLines",
"lsmb/journal/fx_checkbox",
"lsmb/layout/TableContainer",
"lsmb/login",
"lsmb/loginForm",
"lsmb/MainContentPane",
"lsmb/MaximizeMinimize",
"lsmb/menus/Tree",
Expand Down

0 comments on commit 50e840b

Please sign in to comment.