From 0dc13d098fbd0cd7106ab99f0ed617827e89d72b Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 6 Apr 2017 11:33:24 +0200 Subject: reset password field properties before we hide it Signed-off-by: Bjoern Schiessle --- core/js/sharedialogshareelistview.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 0ec14b30152..555ca7fcded 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -515,15 +515,21 @@ var shareId = li.data('share-id'); var passwordContainerClass = '.passwordContainer-' + this.cid + '-' + shareId; var passwordContainer = $(passwordContainerClass); + var loading = this.$el.find(passwordContainerClass + ' .icon-loading-small'); var inputClass = '#passwordField-' + this.cid + '-' + shareId; var passwordField = $(inputClass); var state = element.prop('checked'); - passwordContainer.toggleClass('hidden', !state); if (!state) { this.model.updateShare(shareId, {password: ''}); passwordField.attr('value', ''); + passwordField.removeClass('error'); + passwordField.tooltip('hide'); + loading.addClass('hidden'); passwordField.attr('placeholder', PASSWORD_PLACEHOLDER_MESSAGE); + // We first need to reset the password field before we hide it + passwordContainer.toggleClass('hidden', !state); } else { + passwordContainer.toggleClass('hidden', !state); passwordField = '#passwordField-' + this.cid + '-' + shareId; this.$(passwordField).focus(); } -- cgit v1.2.3