From 8da00bcdc47481a64e3e8bb5a26a4a1b76ca39b4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 1 Dec 2024 15:23:13 +0800 Subject: [PATCH] bugfix --- bricks/css/bricks.css | 6 ++++++ bricks/llm.js | 1 + bricks/menu.js | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bricks/css/bricks.css b/bricks/css/bricks.css index d4406de..2e29901 100755 --- a/bricks/css/bricks.css +++ b/bricks/css/bricks.css @@ -7,6 +7,10 @@ body { display: flex; } +pre { + overflow-x: auto; /* 允许内容超出容器显示 */ + background-color: #b5e5e5; +} * { box-sizing: border-box!important; } @@ -436,3 +440,5 @@ hr { .llm_title { background-color:#eeeeee; } + + diff --git a/bricks/llm.js b/bricks/llm.js index 4cab3d2..43aa7cf 100644 --- a/bricks/llm.js +++ b/bricks/llm.js @@ -118,6 +118,7 @@ bricks.ModelOutput = class extends bricks.HBox { this.run = null; var w = await bricks.widgetBuild(this.output_view, this.llmio, data); w.set_css('llm_msg'); + w.set_style('width', '100%'); this.filler.clear_widgets(); this.filler.add_widget(w); this.filler.add_widget(this.estimate_w); diff --git a/bricks/menu.js b/bricks/menu.js index f0a7d97..92876d9 100644 --- a/bricks/menu.js +++ b/bricks/menu.js @@ -55,13 +55,17 @@ bricks.Menu = class extends bricks.VBox { itw.add_widget(subw); itw.add_widget(w1); this.create_children(w1, item.items); - subw.bind('click', w1.toggle_hide.bind(w1)); + subw.bind('click', this.items_toggle_hide.bind(this, w1)); } else { subw.bind('click', this.regen_menuitem_event.bind(this, item)) w.add_widget(subw); } } } + items_toggle_hide(w, event){ + w.toggle_hide(); + event.stopPropagation(); + } create_menuitem(item){ var w = new bricks.HBox({cheight:this.item_cheight||2}); var iw, tw;