Support for showing a threaded comment reply inline using ajax. Falls back to default if javascript is disabled.

This commit is contained in:
Adam Lewis
2008-05-29 08:23:25 -04:00
committed by Chris Morgan
parent 2503d2ba21
commit be6a19f95e
5 changed files with 4316 additions and 6 deletions

View File

@@ -40,3 +40,30 @@ function DoNav(sUrl)
{
document.location.href = sUrl;
}
/**
* commentId is the uniquely identifying comment id from the database.
* It is also used as the div id for the comment body.
*/
function showComment(commentid)
{
elem = $(commentid);
if(elem.visible() && !elem.empty())
{
elem.hide();
}
else
{
// Cache the contents of the comment body so we don't need to hit db again.
if(elem.empty())
{
new Ajax.Updater(commentid, 'comment_body.php', {
method: 'get',
parameters: {
iCommentId: commentid
}
});
}
elem.show();
}
}