changeset 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 a9bb32706aa6
children c3cc431b7fb9
files gpp/forums/static/js/forums.js
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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');