@@ -41,14 +41,17 @@ function initComment() {
41
41
tpl . find ( ".comment-name" ) . attr ( "href" , json . comment . website ) . text ( json . comment . author ) ;
42
42
tpl . find ( ".comment-reply" ) . attr ( "rel" , json . comment . id ) ;
43
43
tpl . find ( ".comment-content" ) . html ( "<p>" + json . comment . content + "</p>" ) ;
44
- var date = new Date ( json . comment . create_time ) ;
45
44
tpl . find ( ".comment-message" ) . html ( "Your comment is awaiting moderation." ) ;
46
45
tpl . attr ( "id" , "comment-" + json . comment . id ) ;
47
46
if ( json . comment . status == "approved" ) {
48
47
tpl . find ( ".comment-check" ) . remove ( ) ;
49
48
}
50
49
var parentId = $ ( '#comment-parent' ) . val ( ) ;
51
- tpl . insertAfter ( $ ( '#comment-' + parentId ) ) ;
50
+ if ( parentId === '0' ) {
51
+ $ ( '#comment-list' ) . append ( tpl ) ;
52
+ } else {
53
+ tpl . insertAfter ( $ ( '#comment-' + parentId ) ) ;
54
+ }
52
55
$ ( '#comment-cancel' ) . trigger ( "click" ) ;
53
56
$ ( '#comment-content' ) . val ( "" ) ;
54
57
} else {
@@ -62,7 +65,6 @@ function initComment() {
62
65
form . removeClass ( "hide" ) . insertAfter ( $ ( this ) ) ;
63
66
$ ( '#comment-show' ) . hide ( ) ;
64
67
$ ( '#comment-parent' ) . val ( id ) ;
65
- $ ( '#comment-form' ) . removeClass ( "hide" ) ;
66
68
$ ( '.cancel-reply' ) . show ( ) ;
67
69
var top = parentComment . offset ( ) . top ;
68
70
$ ( 'body,html' ) . animate ( { scrollTop : top } , 500 ) ;
0 commit comments