Merge pull request #5972 from nextcloud/replace-loading-icon-gif-with-pure-css-in-login-button

Replace loading icon GIF with pure CSS in login button
This commit is contained in:
Morris Jobke 2017-08-08 14:40:35 +02:00 committed by GitHub
commit d7645ee928
5 changed files with 53 additions and 4 deletions

View File

@ -66,7 +66,7 @@ input.primary {
}
@if (lightness($color-primary) > 50) {
#body-login input.login {
#body-login #submit-icon.icon-confirm-white {
background-image: url('../../../core/img/actions/confirm.svg');
}
}

View File

@ -131,6 +131,28 @@ form #datadirField legend {
}
/* Buttons and input */
#submit-wrapper {
position: relative; /* Make the wrapper the containing block of its
absolutely positioned descendant icons */
}
#submit-wrapper .icon-confirm-white {
position: absolute;
top: 23px;
right: 23px;
}
#submit-wrapper .icon-loading-small {
position: absolute;
top: 22px;
right: 24px;
}
#submit-wrapper #submit-icon {
pointer-events: none; /* The submit icon is positioned on the submit button.
From the user point of view the icon is part of the
button, so the clicks on the icon have to be
applied to the button instead. */
}
input, textarea, select, button {
font-family: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
}

View File

@ -754,6 +754,29 @@ label.infield {
/* Log in and install button */
#body-login #submit-wrapper {
position: relative; /* Make the wrapper the containing block of its
absolutely positioned descendant icons */
.icon-confirm-white {
position: absolute;
top: 23px;
right: 23px;
}
.icon-loading-small {
position: absolute;
top: 22px;
right: 24px;
}
#submit-icon {
pointer-events: none; /* The submit icon is positioned on the submit
button. From the user point of view the icon is
part of the button, so the clicks on the icon
have to be applied to the button instead. */
}
}
#body-login input {
font-size: 20px;
margin: 5px;

View File

@ -12,9 +12,10 @@
*/
OC.Login = _.extend(OC.Login || {}, {
onLogin: function () {
$('#submit')
$('#submit-icon')
.removeClass('icon-confirm-white')
.addClass('icon-loading-small')
.addClass('icon-loading-small');
$('#submit')
.attr('value', t('core', 'Logging in …'));
return true;
},

View File

@ -61,7 +61,10 @@ script('core', 'merged-login');
</p>
<?php } ?>
<input type="submit" id="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Log in')); ?>" disabled="disabled" />
<div id="submit-wrapper">
<input type="submit" id="submit" class="login primary" title="" value="<?php p($l->t('Log in')); ?>" disabled="disabled" />
<div id="submit-icon" class="icon-confirm-white"></div>
</div>
<div class="login-additional">
<div class="remember-login-container">