diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-12-02 13:14:25 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-12-08 10:29:51 +0100 |
commit | 3ac8d422ded4f2bc1064448041cadb4727e2c1ef (patch) | |
tree | 563fc7207bf038c5773a89a3910a349c65bf6764 /core/js/sharedialogshareelistview.js | |
parent | 056e59af7e98a8526739a441e052b5af6d7f8320 (diff) | |
download | nextcloud-server-3ac8d422ded4f2bc1064448041cadb4727e2c1ef.tar.gz nextcloud-server-3ac8d422ded4f2bc1064448041cadb4727e2c1ef.zip |
disable checkboxes during save op to avoid race conditions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/js/sharedialogshareelistview.js')
-rw-r--r-- | core/js/sharedialogshareelistview.js | 13 |
1 files changed, 12 insertions, 1 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; }, |