]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Better UI for showing 'processing' for NewDirectMessage. Displays it
authorSarven Capadisli <csarven@status.net>
Fri, 27 Nov 2009 20:52:35 +0000 (20:52 +0000)
committerSarven Capadisli <csarven@status.net>
Fri, 27 Nov 2009 20:52:35 +0000 (20:52 +0000)
only while it GETs the form.

js/util.js

index b29ce7f02cac35e1f54560dda29c7815c5eabdcd..f3b71cea8bb54d21d316de9cca30d50cce0d5184 100644 (file)
@@ -365,9 +365,9 @@ var SN = { // StatusNet
             NDM = $('.entity_send-a-message a');
             NDM.attr({'href':NDM.attr('href')+'&ajax=1'});
             NDM.bind('click', function() {
-                $(this).addClass('processing');
                 var NDMF = $('.entity_send-a-message form');
                 if (NDMF.length === 0) {
+                    $(this).addClass('processing');
                     $.get(NDM.attr('href'), null, function(data) {
                         $('.entity_send-a-message').append(document._importNode($('form', data)[0], true));
                         NDMF = $('.entity_send-a-message .form_notice');
@@ -378,14 +378,13 @@ var SN = { // StatusNet
                             NDMF.hide();
                             return false;
                         });
+                        NDM.removeClass('processing');
                     });
                 }
                 else {
                     NDMF.show();
                     $('.entity_send-a-message textarea').focus();
                 }
-
-                $(this).removeClass('processing');
                 return false;
             });
         }