diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-11-16 16:19:13 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-11-20 14:40:40 +0100 |
commit | 7a9ea03943767f048f4b121b0f4a435512bc13cf (patch) | |
tree | 7a2f4b0c6f2b27747f6dad6c6610aae4b486ebfe /core/js | |
parent | def8af3e7e1f4328860f5c2d0c1643e0553f58e0 (diff) | |
download | nextcloud-server-7a9ea03943767f048f4b121b0f4a435512bc13cf.tar.gz nextcloud-server-7a9ea03943767f048f4b121b0f4a435512bc13cf.zip |
Fix share link password input
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/share/sharedialoglinkshareview_popover_menu.handlebars | 1 | ||||
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 13 | ||||
-rw-r--r-- | core/js/sharetemplates.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialoglinkshareview.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialogviewSpec.js | 10 |
5 files changed, 14 insertions, 14 deletions
diff --git a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars index 59312bc70b0..3f47f62d68a 100644 --- a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars +++ b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars @@ -58,6 +58,7 @@ <li class="{{#unless isPasswordSet}}hidden{{/unless}} linkPassMenu"> <span class="menuitem icon-share-pass"> <input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" autocomplete="new-password" /> + <input type="submit" class="icon-confirm share-pass-submit" value="" /> <span class="icon icon-loading-small hidden"></span> </span> </li> diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index e10193067db..a28b05aa75a 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -54,8 +54,8 @@ // hide download 'change .hideDownloadCheckbox': 'onHideDownloadChange', // password - 'focusout input.linkPassText': 'onPasswordEntered', - 'keyup input.linkPassText': 'onPasswordKeyUp', + 'click input.share-pass-submit': 'onPasswordEntered', + 'keyup input.linkPassText': 'onPasswordKeyUp', // check for the enter key 'change .showPasswordCheckbox': 'onShowPasswordClick', 'change .passwordByTalkCheckbox': 'onPasswordByTalkChange', 'change .publicEditingCheckbox': 'onAllowPublicEditingChange', @@ -381,11 +381,12 @@ }, error: function(model, msg) { // destroy old tooltips - $input.tooltip('destroy'); + var $container = $input.parent(); + $container.tooltip('destroy'); $input.addClass('error'); - $input.attr('title', msg); - $input.tooltip({placement: 'bottom', trigger: 'manual'}); - $input.tooltip('show'); + $container.attr('title', msg); + $container.tooltip({placement: 'bottom', trigger: 'manual'}); + $container.tooltip('show'); } }); }, diff --git a/core/js/sharetemplates.js b/core/js/sharetemplates.js index eb3489f6b4e..d982b242c48 100644 --- a/core/js/sharetemplates.js +++ b/core/js/sharetemplates.js @@ -154,7 +154,7 @@ templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(cont + alias4(((helper = (helper = helpers.cid || (depth0 != null ? depth0.cid : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data}) : helper))) + "\" class=\"linkPassText\" type=\"password\" placeholder=\"" + alias4(((helper = (helper = helpers.passwordPlaceholder || (depth0 != null ? depth0.passwordPlaceholder : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordPlaceholder","hash":{},"data":data}) : helper))) - + "\" autocomplete=\"new-password\" />\n <span class=\"icon icon-loading-small hidden\"></span>\n </span>\n </li>\n"; + + "\" autocomplete=\"new-password\" />\n <input type=\"submit\" class=\"icon-confirm share-pass-submit\" value=\"\" />\n <span class=\"icon icon-loading-small hidden\"></span>\n </span>\n </li>\n"; },"9":function(container,depth0,helpers,partials,data) { return "disabled=\"disabled\""; },"11":function(container,depth0,helpers,partials,data) { diff --git a/core/js/tests/specs/sharedialoglinkshareview.js b/core/js/tests/specs/sharedialoglinkshareview.js index c2d84fd2e87..0272b07297e 100644 --- a/core/js/tests/specs/sharedialoglinkshareview.js +++ b/core/js/tests/specs/sharedialoglinkshareview.js @@ -186,13 +186,11 @@ describe('OC.Share.ShareDialogLinkShareView', function () { }); view.render(); - var $passwordDiv = view.$el.find('#linkPass'); $passwordText = view.$el.find('.linkPassText'); $workingIcon = view.$el.find('.linkPassMenu .icon-loading-small'); sinon.stub(shareModel, 'saveLinkShare'); - expect($passwordDiv.hasClass('hidden')).toBeFalsy(); expect($passwordText.hasClass('hidden')).toBeFalsy(); expect($workingIcon.hasClass('hidden')).toBeTruthy(); diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 8d5a2ae434d..83ec459dc90 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -127,7 +127,7 @@ describe('OC.Share.ShareDialogView', function() { describe('Share with link', function() { // TODO: test ajax calls // TODO: test password field visibility (whenever enforced or not) - it('update password on focus out', function() { + it('update password on enter', function() { $('#allowShareWithLink').val('yes'); dialog.model.set({ @@ -137,11 +137,11 @@ describe('OC.Share.ShareDialogView', function() { }); dialog.render(); - // Enable password, enter password and focusout + // Enable password and enter password dialog.$el.find('[name=showPassword]').click(); dialog.$el.find('.linkPassText').focus(); dialog.$el.find('.linkPassText').val('foo'); - dialog.$el.find('.linkPassText').focusout(); + dialog.$el.find('.linkPassText').trigger(new $.Event('keyup', {keyCode: 13})); expect(saveLinkShareStub.calledOnce).toEqual(true); expect(saveLinkShareStub.firstCall.args[0]).toEqual({ @@ -149,7 +149,7 @@ describe('OC.Share.ShareDialogView', function() { password: 'foo' }); }); - it('update password on enter', function() { + it('update password on submit', function() { $('#allowShareWithLink').val('yes'); dialog.model.set({ @@ -163,7 +163,7 @@ describe('OC.Share.ShareDialogView', function() { dialog.$el.find('[name=showPassword]').click(); dialog.$el.find('.linkPassText').focus(); dialog.$el.find('.linkPassText').val('foo'); - dialog.$el.find('.linkPassText').trigger(new $.Event('keyup', {keyCode: 13})); + dialog.$el.find('.linkPassText + .icon-confirm').click(); expect(saveLinkShareStub.calledOnce).toEqual(true); expect(saveLinkShareStub.firstCall.args[0]).toEqual({ |