瀏覽代碼

frontend: fix `auto_scroll_bottom` don't work when `output_animation`=False

wangweimin 4 年之前
父節點
當前提交
83726e910b
共有 1 個文件被更改,包括 13 次插入7 次删除
  1. 13 7
      webiojs/src/handlers/output.ts

+ 13 - 7
webiojs/src/handlers/output.ts

@@ -58,13 +58,19 @@ export class OutputHandler implements CommandHandler {
                 }
             }
 
-            if (config.outputAnimation && DISPLAY_NONE_TAGS.indexOf(elem[0].tagName.toLowerCase()) == -1 && container_elem.length == 1) elem.fadeIn({
-                complete: () => {
-                    // 当设置了AutoScrollBottom、并且当前输出输出到页面末尾时,滚动到底部
-                    if (state.AutoScrollBottom && output_to_root)
-                        this.scroll_bottom();
-                }
-            });
+            if (DISPLAY_NONE_TAGS.indexOf(elem[0].tagName.toLowerCase()) == -1 && container_elem.length == 1) {  // 输出内容为可见标签且输出目的scope唯一
+                if (config.outputAnimation)
+                    elem.fadeIn({
+                        complete: () => {
+                            // 当设置了AutoScrollBottom、并且当前输出输出到页面末尾时,滚动到底部
+                            if (state.AutoScrollBottom && output_to_root)
+                                this.scroll_bottom();
+                        }
+                    });
+                else if (state.AutoScrollBottom && output_to_root)
+                    this.scroll_bottom();
+
+            }
         } else if (msg.command === 'output_ctl') {
             this.handle_output_ctl(msg);
         }