summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-29 15:30:01 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-29 15:30:01 +0200
commit8def1383c8bfaad55cf7917af275b23977236323 (patch)
treec782cb4591a0102f3ccf4323bb9a7fe595fab5c6 /core
parent733673b39d42507441cd46e42a913f5754c790e8 (diff)
downloadnextcloud-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.js22
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() {