]> source.dussan.org Git - nextcloud-server.git/commitdiff
feedback to the user while request is being processed
authorThomas Mueller <thomas.mueller@tmit.eu>
Wed, 12 Dec 2012 11:34:28 +0000 (12:34 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Wed, 12 Dec 2012 11:34:28 +0000 (12:34 +0100)
core/js/share.js

index 9f71f1bb66b884d68eaf2905b1e27e126194ed9e..df5ebf008b4d840b7b9d89a52749ce815f26fcea 100644 (file)
@@ -170,7 +170,7 @@ OC.Share={
                                html += '</div>';
                 html += '<form id="emailPrivateLink" >';
                 html += '<input id="email" style="display:none; width:65%;" value="" placeholder="'+t('core', 'Email link to person')+'" type="text" />';
-                html += '<input id="emailButton" style="display:none;" type="submit" value="'+t('core', 'Send')+'" />';
+                html += '<input id="emailButton" style="display:none; float:right;" type="submit" value="'+t('core', 'Send')+'" />';
                 html += '</form>';
                        }
                        html += '<div id="expiration">';
@@ -564,7 +564,14 @@ $(document).ready(function() {
         var file = $('tr').filterAttr('data-id', String(itemSource)).data('file');
         var email = $('#email').val();
         if (email != '') {
-            $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'email', toaddress: email, link: link, itemType: itemType, itemSource: itemSource, file: file}, function(result) {
+            $('#email').attr('disabled', "disabled");
+            $('#email').val(t('core', 'Sending ...'));
+            $('#emailButton').attr('disabled', "disabled");
+
+            $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'email', toaddress: email, link: link, itemType: itemType, itemSource: itemSource, file: file},
+                function(result) {
+                    $('#email').attr('disabled', "false");
+                    $('#emailButton').attr('disabled', "false");
                 if (result && result.status == 'success') {
                     $('#email').css('font-weight', 'bold');
                     $('#email').animate({ fontWeight: 'normal' }, 2000, function() {