Bläddra i källkod

对话页面滚动条问题修复

wangqi49 5 månader sedan
förälder
incheckning
0f19a19365

+ 1 - 1
src/main/resources/static/js/client/rag.js

@@ -1,7 +1,7 @@
-$("#agent-chat-container").load("/client/rag");
 $("#closeAgentIcon").on('click', function () {
     $("#agent-container").fadeOut(300);
 })
 $("#rag").on('click', function () {
+    $("#agent-chat-container").load("/client/rag");
     $("#agent-container").fadeIn(200);
 })

+ 4 - 4
src/main/resources/templates/client/rag.html

@@ -265,7 +265,7 @@
                     hljs.highlightBlock(block);
                 });
                 $("#agent-message-"+agentMessageId).html(marked.parse(systemMessage).replaceAll("&lt;", "<").replaceAll("&gt;", ">"));
-                refreshChatMessContainerScrollBar2Bottom();
+                refreshChatMessRagContainerScrollBar2Bottom();
             }
         };
         eventSource.onerror = function(e){
@@ -332,7 +332,7 @@
             "                <div style=\"clear: both\"></div>\n" +
             "            </div>";
         $("#rag-chat-message-container").append(item);
-        refreshChatMessContainerScrollBar2Bottom();
+        refreshChatMessRagContainerScrollBar2Bottom();
     }
 
     function createRobotChatItem(messageItemId) {
@@ -344,10 +344,10 @@
             "                <div style=\"clear: both\"></div>\n" +
             "            </div>";
         $("#rag-chat-message-container").append(item);
-        refreshChatMessContainerScrollBar2Bottom();
+        refreshChatMessRagContainerScrollBar2Bottom();
     }
 
-    function refreshChatMessContainerScrollBar2Bottom() {
+    function refreshChatMessRagContainerScrollBar2Bottom() {
         $("#rag-chat-message-container").scrollTop($("#rag-chat-message-container")[0].scrollHeight);
     }
 </script>