Permalink
Browse files

HTML validation, avoid empty <ul>

  • Loading branch information...
1 parent f0949b8 commit 293fa809414bd3c01935609c20f3e2813f6fab81 @andyst andyst committed Feb 13, 2010
Showing with 4 additions and 1 deletion.
  1. +1 −1 modules/comment/js/comment.js
  2. +3 −0 modules/comment/views/comments.html.php
View
2 modules/comment/js/comment.js
@@ -29,7 +29,7 @@ function ajaxify_comment_form() {
dataType: "json",
success: function(data) {
if (data.result == "success") {
- $("#g-comments #g-comment-detail ul").append(data.view);
+ $("#g-comments #g-comment-detail ul").append(data.view);
$("#g-comments #g-comment-detail ul li:last").effect("highlight", {color: "#cfc"}, 8000);
$("#g-comment-form").hide(2000).remove();
$("#g-no-comments-yet").hide(2000);
View
3 modules/comment/views/comments.html.php
@@ -10,7 +10,9 @@ class="g-button ui-corner-all ui-icon-left ui-state-default right">
<?= t("No comments yet. Be the first to <a %attrs>comment</a>!",
array("attrs" => html::mark_clean("id= \"g-no-comments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?>
</p>
+<ul>&nbsp;</ul>
<? endif ?>
+<? if ($comments->count()): ?>
<ul>
<? foreach ($comments as $comment): ?>
<li id="g-comment-<?= $comment->id ?>">
@@ -39,4 +41,5 @@ class="g-avatar"
</li>
<? endforeach ?>
</ul>
+<? endif ?>
</div>

0 comments on commit 293fa80

Please sign in to comment.