From b1f96f9bb7f8a26c83e41efb85f5c88ea51fc984 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Fri, 5 Oct 2018 16:06:52 +0200 Subject: [PATCH] when clicking on login there is processing dialog visible (to prevent double click) --- frontend-js/src/main/js/minerva.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/frontend-js/src/main/js/minerva.js b/frontend-js/src/main/js/minerva.js index 3d524d5e6d..34d98369c3 100644 --- a/frontend-js/src/main/js/minerva.js +++ b/frontend-js/src/main/js/minerva.js @@ -498,18 +498,18 @@ function createFooter() { type: "div", className: "minerva-footer-table", content: '<table width="100%" border="0" cellspacing="0" cellpadding="0">' + - '<tr>' + - '<td align="left"><a href="' + logoLink + '" title="' + logoText + '" target="_blank">' + - '<img src="' + GuiConnector.getImgPrefix() + logoImg + '" width="80" height="80" border="0" alt="' + logoText + '"/>' + - '</a></td>' + - '<td align="center" class="minerva-footer-text">MiNERVA version ' + configuration.getVersion() + ';<br/>' + - 'build ' + configuration.getBuildDate() + ';<br/>' + - 'git: ' + configuration.getGitHash() + '</td>' + - '<td align="right"><a href="http://wwwen.uni.lu/lcsb/" title="LCSB - Luxembourg Centre for Systems Biomedicine" target="_blank">' + - '<img src="' + GuiConnector.getImgPrefix() + 'lcsb.png" width="80" height="80" border="0" alt="LCSB - Luxembourg Centre for Systems Biomedicine"/>' + - '</a></td>' + - '</tr>\n' + - '</table>', xss: false + '<tr>' + + '<td align="left"><a href="' + logoLink + '" title="' + logoText + '" target="_blank">' + + '<img src="' + GuiConnector.getImgPrefix() + logoImg + '" width="80" height="80" border="0" alt="' + logoText + '"/>' + + '</a></td>' + + '<td align="center" class="minerva-footer-text">MiNERVA version ' + configuration.getVersion() + ';<br/>' + + 'build ' + configuration.getBuildDate() + ';<br/>' + + 'git: ' + configuration.getGitHash() + '</td>' + + '<td align="right"><a href="http://wwwen.uni.lu/lcsb/" title="LCSB - Luxembourg Centre for Systems Biomedicine" target="_blank">' + + '<img src="' + GuiConnector.getImgPrefix() + 'lcsb.png" width="80" height="80" border="0" alt="LCSB - Luxembourg Centre for Systems Biomedicine"/>' + + '</a></td>' + + '</tr>\n' + + '</table>', xss: false }); }) } @@ -578,6 +578,7 @@ function createLoginDiv() { var fromPage = GuiConnector.getParams["from"]; $("#login", result).on("click", function login() { + GuiConnector.showProcessing(); var loginString = document.getElementById('username').value; var passwordString = document.getElementById('password').value; return ServerConnector.login(loginString, passwordString).then(function () { @@ -587,12 +588,14 @@ function createLoginDiv() { } else { window.location.href = ServerConnector.getServerBaseUrl(); } - }, function (error) { + }).catch(function (error) { if (error.constructor.name === "InvalidCredentialsError") { GuiConnector.alert("invalid credentials"); } else { GuiConnector.alert(error); } + }).finally(function () { + GuiConnector.hideProcessing(); }); }); $('#go_to_map_button', result).click(function () { -- GitLab