From c812d2a9314eec3d73f9408cf1f3938edc675b0d Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Mon, 24 Nov 2008 07:12:45 +0000 Subject: Changed comment sort order asc. Changed ajax comment add to append comment li to comment thread ul. Added fadeIn for user login. --- modules/comment/helpers/comment.php | 2 +- themes/default/js/comment.js | 4 ++-- themes/default/js/user.js | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index be44fc13..099a3833 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -108,7 +108,7 @@ class comment_Core { // @todo Set proper Content-Type in a central place (REST_Controller::dispatch?). static function get_comments($item_id) { $comments = ORM::factory('comment')->where('item_id', $item_id) - ->orderby('datetime', 'desc') + ->orderby('datetime', 'asc') ->find_all(); if (!$comments->count()) { diff --git a/themes/default/js/comment.js b/themes/default/js/comment.js index 60e885fb..259b4826 100644 --- a/themes/default/js/comment.js +++ b/themes/default/js/comment.js @@ -8,8 +8,8 @@ function ajaxify_comment_form() { $("#gComments form").replaceWith(xhr.responseText); if (xhr.status == 201) { $.get(xhr.getResponseHeader("Location"), function(data, textStatus) { - $("#gComments div.gBlockContent ul:first").append(data); - $("#gComments div.gBlockContent ul:first li:last").hide().slideDown(); + $("#gComments .gBlockContent ul:first").append("
  • "+data+"
  • "); + $("#gComments .gBlockContent ul:first li:last").hide().slideDown(); }); $("#gComments form").clearForm(); } diff --git a/themes/default/js/user.js b/themes/default/js/user.js index 6c66e35c..a0ff43cd 100644 --- a/themes/default/js/user.js +++ b/themes/default/js/user.js @@ -2,7 +2,6 @@ * @todo preventDefault() not working in IE 6 and 7 * @todo Close link should be reusable */ -var closeLink = '
  • X
  • '; $("document").ready(function() { $("#gLoginLink").click(function(event){ @@ -10,7 +9,7 @@ $("document").ready(function() { var url = $("#gLoginLink a").attr("href"); $.get(url, function(data) { $('#gLoginLink').hide(); - $("#gLoginMenu").append(closeLink); + $("#gLoginMenu").append('
  • X
  • '); $("#gLoginMenu li:last").addClass("gClose").show(); $("#gLoginMenu .gClose a").click(function(){ $("#gLoginForm").remove(); @@ -19,7 +18,7 @@ $("document").ready(function() { $("input#gUsername").val(""); $("input#gPassword").val(""); }); - $("#gLoginFormContainer").html(data); + $("#gLoginFormContainer").html(data).hide().fadeIn(); ajaxify_login_form(); }); }); -- cgit v1.2.3