]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix displaying if a link is password protected
authorMichael Gapczynski <mtgap@owncloud.com>
Wed, 29 Aug 2012 18:06:33 +0000 (14:06 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Wed, 29 Aug 2012 18:06:55 +0000 (14:06 -0400)
core/js/share.js

index 7d2daffb29da3217253fd62805fb1bf81cbb50dd..fa412c7acc579026d57522d7d0521f9aac06aac4 100644 (file)
@@ -282,6 +282,10 @@ OC.Share={
                $('#linkText').val(link);
                $('#linkText').show('blind');
                $('#showPassword').show();
+               if (password.length > 0) {
+                       $('#linkPass').show('blind');
+                       $('#linkPassText').attr('placeholder', 'Password protected');
+               }
        },
        hideLink:function() {
                $('#linkText').hide('blind');
@@ -419,7 +423,10 @@ $(document).ready(function() {
                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.Share.PERMISSION_READ);
+                       OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.Share.PERMISSION_READ, function() {
+                               $('#linkPassText').val('');
+                               $('#linkPassText').attr('placeholder', 'Password protected');
+                       });
                }
        });