disable checkboxes during save op to avoid race conditions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
056e59af7e
commit
3ac8d422de
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue