Browse Source

添加ai对话框

xiaoguang_li 2 months ago
parent
commit
22cca286a3
1 changed files with 7 additions and 1 deletions
  1. 7 1
      desktop/core/src/desktop/templates/assist.mako

+ 7 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -2901,12 +2901,18 @@ from desktop.views import _ko
       };
 
       ChatPanel.prototype.autoResize = function (data, event) {
+        let self = this;
         let inputArea = event.target;
         let value = inputArea.value;
         let oldValue = inputArea.style.height;
         inputArea.style.height = 'auto';
         let newValue = inputArea.scrollHeight;
-        inputArea.style.height = inputArea.scrollHeight -20 + 'px';
+        if (self.query().length === 0) {
+            inputArea.style.height = 24 +'px';
+        } else {
+            inputArea.style.height = inputArea.scrollHeight -20 + 'px';
+        }
+
 
         console.log(new Date() + "  autoResize old:" + oldValue +" -> new:" +newValue +" value:" + value )
       };