@@ -81,13 +81,13 @@ $(function () {
8181
8282 $ ( 'body' ) . on ( 'click' , '.edit_comment' , function ( e ) {
8383 e . preventDefault ( ) ;
84- comment_id = $ ( this ) . attr ( 'name' ) ;
8584 old_message = $ ( this ) . parent ( ) . next ( ) . next ( ) . text ( ) ;
86- $ ( this ) . parent ( ) . next ( ) . show ( ) ;
87- $ ( this ) . parent ( ) . next ( ) . find ( 'textarea' ) . val ( old_message ) ;
85+ comment_id = $ ( this ) . attr ( 'name' ) ;
8886 $ ( this ) . hide ( ) ;
87+ $ ( this ) . next ( '.edit_comment' ) . hide ( ) ;
8988 $ ( this ) . next ( '.del_comment' ) . hide ( ) ;
90- $ ( this ) . parent ( ) . next ( ) . next ( ) . hide ( ) ;
89+ $ ( this ) . parent ( ) . next ( ) . find ( 'textarea' ) . val ( old_message ) ;
90+ $ ( this ) . parent ( ) . parent ( ) . next ( ) . show ( ) ;
9191 } ) ;
9292
9393 $ ( document ) . on ( 'click' , '.edit_form button[type="submit"]' , function ( e ) {
@@ -113,10 +113,7 @@ $(function () {
113113 $ ( 'body' ) . on ( 'click' , '.reply_comment' , function ( e ) {
114114 e . preventDefault ( ) ;
115115 comment_id = $ ( this ) . attr ( 'name' ) ;
116- $ ( this ) . hide ( ) ;
117- $ ( this ) . next ( '.edit_comment' ) . hide ( ) ;
118- $ ( this ) . next ( ) . next ( '.del_comment' ) . hide ( ) ;
119- $ ( this ) . parent ( ) . parent ( ) . next ( ) . show ( ) ;
116+ $ ( this ) . parent ( ) . parent ( ) . parent ( ) . next ( ) . toggle ( ) ;
120117 } ) ;
121118
122119 $ ( document ) . on ( 'click' , '.reply_form button[type="submit"]' , function ( e ) {
0 commit comments