]> source.dussan.org Git - nextcloud-server.git/commitdiff
set password if user leaves password field (issue #57)
authorBjörn Schießle <schiessle@owncloud.com>
Sun, 28 Oct 2012 12:47:29 +0000 (13:47 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Sun, 28 Oct 2012 14:04:41 +0000 (15:04 +0100)
core/js/share.js

index 2f9f10026de1f34859d959a4310aecd7547caca1..5f5bfb0f44c9fb8238daf09406aad0f3dee476ec 100644 (file)
@@ -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() {