summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/js/sharedialogshareelistview.js13
-rw-r--r--core/js/shareitemmodel.js6
2 files changed, 17 insertions, 2 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 5f24b236464..74ba6b9746c 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -437,7 +437,18 @@
permissions |= $(checkbox).data('permissions');
});
- this.model.updateShare(shareId, {permissions: permissions});
+
+ /** disable checkboxes during save operation to avoid race conditions **/
+ $li.find('input[type=checkbox]').prop('disabled', true);
+ var enableCb = function() {
+ $li.find('input[type=checkbox]').prop('disabled', false);
+ };
+ var errorCb = function(elem, msg) {
+ OC.dialogs.alert(msg, t('core', 'Error while sharing'));
+ enableCb();
+ };
+
+ this.model.updateShare(shareId, {permissions: permissions}, {error: errorCb, success: enableCb});
this._renderPermissionChange = shareId;
},
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 4a82630b967..b01f0f790ac 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -573,7 +573,7 @@
return superShare;
},
- fetch: function() {
+ fetch: function(options) {
var model = this;
this.trigger('request', this);
@@ -597,6 +597,10 @@
shares: sharesMap,
reshare: reshare
}));
+
+ if(!_.isUndefined(options) && _.isFunction(options.success)) {
+ options.success();
+ }
});
return deferred;