From 10e45481bec2d9003f6c6ad89591b2d968a05882 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Sun, 28 Oct 2012 13:47:29 +0100 Subject: [PATCH] set password if user leaves password field (issue #57) --- core/js/share.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/js/share.js b/core/js/share.js index 2f9f10026de..5f5bfb0f44c 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -475,15 +475,13 @@ $(document).ready(function() { $('#linkPass').toggle('blind'); }); - $('#linkPassText').live('keyup', function(event) { - if (event.keyCode == 13) { - var itemType = $('#dropdown').data('item-type'); - var itemSource = $('#dropdown').data('item-source'); - OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() { - $('#linkPassText').val(''); - $('#linkPassText').attr('placeholder', t('core', 'Password protected')); - }); - } + $('#linkPassText').live('focusout', function(event) { + var itemType = $('#dropdown').data('item-type'); + var itemSource = $('#dropdown').data('item-source'); + OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() { + $('#linkPassText').val(''); + $('#linkPassText').attr('placeholder', t('core', 'Password protected')); + }); }); $('#expirationCheckbox').live('click', function() { -- 2.39.5