From 6ce976e7f00b96ee8399913482afcddf73f836f1 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Mon, 29 Aug 2016 17:42:43 +0200 Subject: [PATCH] Theming: Show loading spinner while uploading files --- apps/theming/css/settings-admin.css | 14 ++++++++------ apps/theming/js/settings-admin.js | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/theming/css/settings-admin.css b/apps/theming/css/settings-admin.css index 53214b245c..b10c482fbd 100644 --- a/apps/theming/css/settings-admin.css +++ b/apps/theming/css/settings-admin.css @@ -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 { diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index 86f97dc6dc..03fdf2c6a4 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -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); } };