Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
378:a9bb32706aa6 | 379:84bcaff13129 |
---|---|
20 }, | 20 }, |
21 traditional: true, | 21 traditional: true, |
22 dataType: 'html', | 22 dataType: 'html', |
23 success: function (data, textStatus) { | 23 success: function (data, textStatus) { |
24 postText.val(''); | 24 postText.val(''); |
25 $('#forum-topic tr:last').after(data); | |
26 var lastTr = $('#forum-topic tr:last'); | 25 var lastTr = $('#forum-topic tr:last'); |
26 var newClass = lastTr.hasClass('odd') ? 'even' : 'odd'; | |
27 lastTr.after(data); | |
28 lastTr = $('#forum-topic tr:last'); | |
29 lastTr.addClass(newClass); | |
27 lastTr.hide(); | 30 lastTr.hide(); |
28 lastTr.fadeIn(3000); | 31 lastTr.fadeIn(3000); |
29 postButton.removeAttr('disabled').val('Submit Reply'); | 32 postButton.removeAttr('disabled').val('Submit Reply'); |
30 initAttachments(); | 33 initAttachments(); |
31 }, | 34 }, |