]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make email private link submit on enter as well
authorMichael Gapczynski <GapczynskiM@gmail.com>
Thu, 10 May 2012 15:07:06 +0000 (11:07 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Thu, 10 May 2012 15:44:06 +0000 (11:44 -0400)
apps/files_sharing/js/share.js

index e23146798f29959a861887db3d78e919a5b67d6b..faa6c52b2aa6b93ac97ec12aac3d439cf621e46d 100644 (file)
@@ -74,9 +74,11 @@ OC.Share={
                html += '<div id="privateLink">';
                html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>';
                html += '<br />';
+               html += '<form id="emailPrivateLink">';
                html += '<input id="privateLinkText" style="display:none; width:90%;" />';
                html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
                html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
+               html += '</form>';
                html += '</div>';
                $(html).appendTo(appendTo);
                if (OC.Share.usersAndGroups.length < 1) {
@@ -356,7 +358,8 @@ $(document).ready(function() {
                $(this).select();
        });
 
-       $('#emailButton').live('click', function() {
+       $('#emailPrivateLink').live('submit', function() {
+               event.preventDefault();
                OC.Share.emailPrivateLink();
        });
 });
\ No newline at end of file