diff gpp/forums/static/js/forums.js @ 379:84bcaff13129

Added logic to the forums javascript that adds the proper CSS class (odd or even) to a new post.
author Brian Neal <bgneal@gmail.com>
date Wed, 09 Mar 2011 00:49:41 +0000
parents 88b2b9cb8c1f
children 3ac558402014
line wrap: on
line diff
--- a/gpp/forums/static/js/forums.js	Tue Mar 08 03:31:30 2011 +0000
+++ b/gpp/forums/static/js/forums.js	Wed Mar 09 00:49:41 2011 +0000
@@ -22,8 +22,11 @@
          dataType: 'html',
          success: function (data, textStatus) {
             postText.val('');
-            $('#forum-topic tr:last').after(data);
             var lastTr = $('#forum-topic tr:last');
+            var newClass = lastTr.hasClass('odd') ? 'even' : 'odd';
+            lastTr.after(data);
+            lastTr = $('#forum-topic tr:last');
+            lastTr.addClass(newClass);
             lastTr.hide();
             lastTr.fadeIn(3000);
             postButton.removeAttr('disabled').val('Submit Reply');