@@ -884,7 +884,7 @@ public static Object ajaxCommentPreview(Request req, Response resp){
884884 Map <Integer , UserInteractions > interactions =ctx .getWallController ().getUserInteractions (Stream .of (List .of (topLevel ), comments .list ).flatMap (List ::stream ).toList (), self !=null ? self .user : null );
885885 model .with ("postInteractions" , interactions )
886886 .with ("preview" , true )
887- .with ("replyFormID" , (viewType ==CommentViewType .FLAT ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost" )+postID +ridSuffix )
887+ .with ("replyFormID" , (viewType ==CommentViewType .FLAT || isMobile ( req ) ? "wallPostForm_commentPost" : "wallPostForm_commentReplyPost" )+postID +ridSuffix )
888888 .with ("commentViewType" , viewType );
889889 model .with ("topLevel" , topLevel );
890890 WebDeltaResponse rb =new WebDeltaResponse (resp )
@@ -940,7 +940,7 @@ public static Object ajaxCommentBranch(Request req, Response resp){
940940 }
941941 Map <Integer , UserInteractions > interactions =ctx .getWallController ().getUserInteractions (Stream .of (List .of (topLevel ), allReplies ).flatMap (List ::stream ).toList (), self !=null ? self .user : null );
942942 preparePostList (ctx , comments .list , model , self );
943- model .with ("postInteractions" , interactions ).with ("replyFormID" , " wallPostForm_commentReplyPost" +topLevel .post .id +ridSuffix );
943+ model .with ("postInteractions" , interactions ).with ("replyFormID" , ( isMobile ( req ) ? "wallPostForm_commentPost" : " wallPostForm_commentReplyPost") +topLevel .post .id +ridSuffix );
944944 model .with ("topLevel" , topLevel );
945945 model .with ("commentViewType" , viewType );
946946 if (StringUtils .isNotEmpty (rid ))
@@ -1253,11 +1253,11 @@ public static Object ajaxLayerPrevComments(Request req, Response resp){
12531253 model .with ("randomID" , rid );
12541254 preparePostList (ctx , comments .list , model , self );
12551255 Map <Integer , UserInteractions > interactions =ctx .getWallController ().getUserInteractions (Stream .of (List .of (post ), comments .list ).flatMap (List ::stream ).toList (), self !=null ? self .user : null );
1256+ boolean mobile =isMobile (req );
12561257 model .with ("postInteractions" , interactions )
1257- .with ("replyFormID" , " wallPostForm_commentReplyPost" +postID +ridSuffix )
1258+ .with ("replyFormID" , ( mobile ? "wallPostForm_commentPost" : " wallPostForm_commentReplyPost") +postID +ridSuffix )
12581259 .with ("commentViewType" , viewType );
12591260 model .with ("topLevel" , post );
1260- boolean mobile =isMobile (req );
12611261 WebDeltaResponse rb =new WebDeltaResponse (resp )
12621262 .runScript (mobile ? "window._layerScrollHeight=document.scrollingElement.scrollHeight;" : "window._layerScrollHeight=ge(\" postReplies" +postID +ridSuffix +"\" ).closest(\" .layerContent\" ).scrollHeight;" )
12631263 .insertHTML (WebDeltaResponse .ElementInsertionMode .AFTER_BEGIN , "postReplies" +postID +ridSuffix , model .renderToString ())
0 commit comments