diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-09-29 15:30:01 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-29 15:30:01 +0200 |
commit | 8def1383c8bfaad55cf7917af275b23977236323 (patch) | |
tree | c782cb4591a0102f3ccf4323bb9a7fe595fab5c6 /core | |
parent | 733673b39d42507441cd46e42a913f5754c790e8 (diff) | |
download | nextcloud-server-8def1383c8bfaad55cf7917af275b23977236323.tar.gz nextcloud-server-8def1383c8bfaad55cf7917af275b23977236323.zip |
Fix share link password error
- only allow submitting the password once, single request
- display error in tooltip
Diffstat (limited to 'core')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index cb9325231dd..3d8fb461461 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -144,17 +144,33 @@ }, onPasswordEntered: function() { - var password = this.$el.find('#linkPassText').val(); + var self = this; + var $loading = this.$el.find('#linkPass .icon-loading-small'); + if (!$loading.hasClass('hidden')) { + // still in process + return; + } + var $input = this.$el.find('#linkPassText'); + $input.removeClass('error'); + var password = $input.val(); if(password === '') { return; } - this.$el.find('#linkPass .icon-loading-small') + $loading .removeClass('hidden') .addClass('inlineblock'); this.model.setPassword(password); - this.model.saveLinkShare(); + this.model.saveLinkShare({}, { + error: function(model, msg) { + $loading.removeClass('inlineblock').addClass('hidden'); + $input.addClass('error'); + $input.attr('title', msg); + $input.tooltip({placement: 'bottom', trigger: 'manual'}); + $input.tooltip('show'); + } + }); }, onAllowPublicUploadChange: function() { |