summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2016-04-07 13:52:34 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2016-04-07 13:52:34 +0200
commitbe9b685926c3a9fd899755d99445623f886f2d8f (patch)
treef1432a6e0052516bbafe48e7a061ed4689e56760
parent0de15a86f057c8b0e88f353762059d4e0971b780 (diff)
parent73d5889c5d7553add63fe5b6c07f42a306a75aeb (diff)
downloadnextcloud-server-be9b685926c3a9fd899755d99445623f886f2d8f.tar.gz
nextcloud-server-be9b685926c3a9fd899755d99445623f886f2d8f.zip
Merge pull request #23444 from owncloud/add-loading-spinner
Add loading spinner to "Add to owncloud"
-rw-r--r--apps/files_sharing/js/public.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 70d5d619c12..2d93bc17996 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -292,6 +292,24 @@ OCA.Sharing.PublicApp = {
},
_saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
+ var toggleLoading = function() {
+ var iconClass = $('#save-button-confirm').attr('class');
+ var loading = iconClass.indexOf('icon-loading-small') !== -1;
+ if(loading) {
+ $('#save-button-confirm')
+ .removeClass("icon-loading-small")
+ .addClass("icon-confirm");
+
+ }
+ else {
+ $('#save-button-confirm')
+ .removeClass("icon-confirm")
+ .addClass("icon-loading-small");
+
+ }
+ };
+
+ toggleLoading();
var location = window.location.protocol + '//' + window.location.host + OC.webroot;
if(remote.substr(-1) !== '/') {
@@ -309,6 +327,7 @@ OCA.Sharing.PublicApp = {
// this check needs to happen on the server due to the Content Security Policy directive
$.get(OC.generateUrl('apps/files_sharing/testremote'), {remote: remote}).then(function (protocol) {
if (protocol !== 'http' && protocol !== 'https') {
+ toggleLoading();
OC.dialogs.alert(t('files_sharing', 'No ownCloud installation (7 or higher) found at {remote}', {remote: remote}),
t('files_sharing', 'Invalid ownCloud url'));
} else {