Commits

Anonymous committed 2a35e8c

Removed the 'selector' variable - all the selectors will need to be customized for each individual project.

Comments (0)

Files changed (1)

ajaxcomments/media/js/post-comment.js

 
 function ajaxComment(args) {
     // TODO: if the media variable ends in a forward slash, remove it.
-    var selector = args.selector;
     var media = args.media;
     
     $('div.comment-error').remove();
     
     if (commentBusy) {
-        $(selector).before('\
+        $('div.comment-form form').before('\
             <div class="comment-error">\
                 Your comment is currently in the process of posting.\
             </div>\
         return false;
     }
     
-    comment = $(selector).serialize();
+    comment = $('div.comment-form form').serialize();
    
     // Add a wait animation
     $('input.submit-post').after('\
     
     commentBusy = true;
     
-    url = $(selector).attr('action');
+    url = $('div.comment-form form').attr('action');
     
     // Use AJAX to post the comment.
     $.ajax({
             
             removeWaitAnimation()
             
-            $(selector).unbind('submit');
-            $(selector).submit();
+            $('div.comment-form form').unbind('submit');
+            $('div.comment-form form').submit();
         },
         dataType: 'json'
     });