Theming: Show loading spinner while uploading files

This commit is contained in:
Julius Haertl 2016-08-29 17:42:43 +02:00
parent f8a45b9e08
commit 6ce976e7f0
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
2 changed files with 14 additions and 6 deletions

View File

@ -9,12 +9,13 @@
#theming .theme-undo {
cursor: pointer;
opacity: .5;
padding: 9px;
vertical-align: bottom;
padding: 11px 5px;
vertical-align: top;
display: inline-block;
}
#theming .icon {
display: inline-block;
#theming .icon-loading-small:after {
margin: -10px 0 0 -10px;
}
#theming label span {
@ -23,10 +24,11 @@
padding: 8px 0px;
}
#theming .icon-upload {
#theming .icon-upload,
#theming .icon-loading-small {
display: inline-flex;
padding: 8px;
margin: 0;
margin: 2px 0px;
}
div#theming_settings_msg {

View File

@ -112,12 +112,15 @@ $(document).ready(function () {
done: function (e, response) {
preview('logoMime', response.result.data.name);
OC.msg.finishedSaving('#theming_settings_msg', response.result);
$('label#uploadlogo').addClass('icon-upload').removeClass('icon-loading-small');
},
submit: function(e, response) {
OC.msg.startSaving('#theming_settings_msg');
$('label#uploadlogo').removeClass('icon-upload').addClass('icon-loading-small');
},
fail: function (e, response){
OC.msg.finishedError('#theming_settings_msg', response._response.jqXHR.responseJSON.data.message);
$('label#uploadlogo').addClass('icon-upload').removeClass('icon-loading-small');
}
};
var uploadParamsLogin = {
@ -126,11 +129,14 @@ $(document).ready(function () {
done: function (e, response) {
preview('backgroundMime', response.result.data.name);
OC.msg.finishedSaving('#theming_settings_msg', response.result);
$('label#upload-login-background').addClass('icon-upload').removeClass('icon-loading-small');
},
submit: function(e, response) {
OC.msg.startSaving('#theming_settings_msg');
$('label#upload-login-background').removeClass('icon-upload').addClass('icon-loading-small');
},
fail: function (e, response){
$('label#upload-login-background').removeClass('icon-loading-small').addClass('icon-upload');
OC.msg.finishedError('#theming_settings_msg', response._response.jqXHR.responseJSON.data.message);
}
};