summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-12 14:01:15 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-12 14:01:15 +0100
commit51b55d53206ec8731611e6a36bf8d7e3317a451a (patch)
treee3996080cacb4a9b16fc86451bae2ee64ce8f270 /core/js
parentf8607ac1327f3254f6f4fe86c8418f1b3d447730 (diff)
downloadnextcloud-server-51b55d53206ec8731611e6a36bf8d7e3317a451a.tar.gz
nextcloud-server-51b55d53206ec8731611e6a36bf8d7e3317a451a.zip
Provide proper feedback when creating a share in the webUI
Fixes #22304 Creating a share is not instant (especially not for federated shares) so we should show that something is happening in the webUI properly.
Diffstat (limited to 'core/js')
-rw-r--r--core/js/sharedialogview.js14
-rw-r--r--core/js/shareitemmodel.js8
2 files changed, 15 insertions, 7 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 4cebf7962e8..02e0e673caa 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -233,8 +233,18 @@
_onSelectRecipient: function(e, s) {
e.preventDefault();
- $(e.target).val('');
- this.model.addShare(s.item.value);
+ $(e.target).attr('disabled', true)
+ .val(s.item.label);
+ var $loading = this.$el.find('.shareWithLoading');
+ $loading.removeClass('hidden')
+ .addClass('inlineblock');
+
+ this.model.addShare(s.item.value, {success: function() {
+ $(e.target).val('')
+ .attr('disabled', false);
+ $loading.addClass('hidden')
+ .removeClass('inlineblock');
+ }});
},
_toggleLoading: function(state) {
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index a28bcac91cb..292230d26d5 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -183,11 +183,9 @@
data: attributes,
dataType: 'json'
}).done(function() {
- self.fetch({
- success: function() {
- if (_.isFunction(options.success)) {
- options.success(self);
- }
+ self.fetch().done(function() {
+ if (_.isFunction(options.success)) {
+ options.success(self);
}
});
}).fail(function(xhr) {