From a7e8da9da8fbf50ca15f5550bc319c1941b0bb00 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 6 Dec 2021 12:41:55 +0100 Subject: Add spinner when loading ext storages Signed-off-by: Vincent Petry Signed-off-by: nextcloud-command --- apps/files_external/js/settings.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'apps/files_external/js') diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 32c4b1bc03b..bed380bab14 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -907,6 +907,14 @@ MountConfigListView.prototype = _.extend({ loadStorages: function() { var self = this; + var onLoaded1 = $.Deferred(); + var onLoaded2 = $.Deferred(); + + this.$el.find('.externalStorageLoading').removeClass('hidden'); + $.when(onLoaded1, onLoaded2).always(() => { + self.$el.find('.externalStorageLoading').addClass('hidden'); + }) + if (this._isPersonal) { // load userglobal storages $.ajax({ @@ -953,8 +961,11 @@ MountConfigListView.prototype = _.extend({ $('#emptycontent').show(); } onCompletion.resolve(); + onLoaded1.resolve(); } }); + } else { + onLoaded1.resolve(); } var url = this._storageConfigClass.prototype._url; @@ -973,6 +984,7 @@ MountConfigListView.prototype = _.extend({ self.recheckStorageConfig($tr); }); onCompletion.resolve(); + onLoaded2.resolve(); } }); }, -- cgit v1.2.3