From 1a4d664b5a2debb2cac41af69e19cc8299cc255f Mon Sep 17 00:00:00 2001 From: pipeline-agent Date: Sun, 30 Aug 2026 13:55:35 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20get=5Fby=5Fid=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E5=8E=9F=E7=89=88=E5=88=86=E6=AE=B5=E6=9F=A5=E6=89=BE=E2=80=94?= =?UTF-8?q?=E2=80=94.=E6=98=AF=E6=A1=86=E6=9E=B6=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6=E8=B7=AF=E7=94=B1=E5=88=86=E9=9A=94?= =?UTF-8?q?=E7=AC=A6=EF=BC=8C=E5=90=8E=E7=BC=80=E5=85=9C=E5=BA=95=E6=98=AF?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=B3=95=EF=BC=9BUI=E4=BE=A7?= =?UTF-8?q?=E6=94=B9=E7=94=A8=E8=A3=B8id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bricks/bricks.js | 8 ++------ bricks/header.tmpl | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bricks/bricks.js b/bricks/bricks.js index 7d6299e..5ab7fcd 100644 --- a/bricks/bricks.js +++ b/bricks/bricks.js @@ -614,14 +614,10 @@ bricks.getWidgetById = function(idset, from_widget){ } var el = fromw.dom_element; var nel; - // id 可能是层级路径的末段(DOM id 为完整路径如 app.world_content), - // 先精确匹配,再按 ".末段" 后缀兜底;CSS.escape 防点号被当 class 选择器 - var selExact = '#' + (window.CSS && CSS.escape ? CSS.escape(id) : id); - var selSuffix = '[id$=".' + (window.CSS && CSS.escape ? CSS.escape(id) : id) + '"]'; if(downward ){ - nel = el.querySelector(selExact) || el.querySelector(selSuffix); + nel = el.querySelector('#' + id); } else { - nel = el.closest(selExact) || el.closest(selSuffix); + nel = el.closest('#' + id); } if (!nel) { console.log('get_by_id() return null',id, fromw, downward); diff --git a/bricks/header.tmpl b/bricks/header.tmpl index e4074c1..241a215 100644 --- a/bricks/header.tmpl +++ b/bricks/header.tmpl @@ -37,7 +37,7 @@ - + {% for myjs in jsfiles() %} {% endfor %}