diff options
-rw-r--r-- | modules/comment/views/comments.html.php | 9 | ||||
-rw-r--r-- | themes/default/js/ui.init.js | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index ce99cbe7..575a7eca 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -1,4 +1,10 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> +<? if (!$comments->count()): ?> +<p> + <?= t("No comments yet. Be the first to") ?> + <a href="#add_comment_form" class="showCommentForm"><?= t("comment") ?></a>! +</p> +<? endif ?> <ul id="gComments"> <? foreach ($comments as $comment): ?> <li id="gComment-<?= $comment->id ?>"> @@ -20,7 +26,4 @@ </li> <? endforeach ?> </ul> -<? if (!$comments->count()): ?> -<?= t("No comments yet. Be the first to comment!") ?> -<? endif ?> <a name="add_comment_form"></a> diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 3c6ca777..ffcc3ed3 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -55,10 +55,10 @@ $(document).ready(function() { // Collapse comments form, insert button to expand if ($("#gAddCommentForm").length) { - var showCommentForm = '<a href="#add_comment_form" id="showCommentForm" class="gButtonLink ui-corner-all ui-icon-left ui-state-default right"><span class="ui-icon ui-icon-comment"></span>Add a comment</a>'; + var showCommentForm = '<a href="#add_comment_form" class="showCommentForm gButtonLink ui-corner-all ui-icon-left ui-state-default right"><span class="ui-icon ui-icon-comment"></span>Add a comment</a>'; $("#gAddCommentForm").hide(); $("#gComments").prepend(showCommentForm); - $("#showCommentForm").click(function(){ + $(".showCommentForm").click(function(){ $("#gAddCommentForm").show(1000); }); } |