(css,js) Improve progress feedback

This ads a "ripple" effect that blocks the context when login in or
sending a message. Generic enough to be used elsewhere.

Fixes #3765
This commit is contained in:
Francis Lachapelle
2016-07-15 14:03:16 -04:00
parent 0fe472b5e9
commit 6bbb56c386
13 changed files with 334 additions and 63 deletions
+14 -5
View File
@@ -15,20 +15,29 @@
vm.creds = { username: cookieUsername, password: null };
vm.login = login;
vm.loginState = false;
vm.showAbout = showAbout;
// Show login once everything is initialized
vm.showLogin = false;
$timeout(function() { vm.showLogin = true; }, 100);
function login() {
vm.loginState = 'authenticating';
Authentication.login(vm.creds)
.then(function(url) {
if (window.location.href === url)
window.location.reload(true);
else
window.location.href = url;
vm.loginState = 'logged';
// Let the user see the succesfull message before reloading the page
$timeout(function() {
if (window.location.href === url)
window.location.reload(true);
else
window.location.href = url;
}, 1000);
}, function(msg) {
Dialog.alert(l('Authentication Failed'), msg.error);
vm.loginState = 'error';
vm.errorMessage = msg.error;
});
return false;
}