mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 11:25:24 +00:00
(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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user