revert: get_by_id改回原版分段查找——.是框架设计的控件路由分隔符,后缀兜底是错误修法;UI侧改用裸id
This commit is contained in:
parent
b7b85e063f
commit
1a4d664b5a
@ -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);
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<script type="module"
|
||||
src="{{entire_url('/bricks/3parties/model-viewer.min.js')}}">
|
||||
</script>
|
||||
<script src="{{entire_url('/bricks/bricks.js')}}?v={% if assets_ver %}{{assets_ver()}}{% else %}20260830a{% endif %}"></script>
|
||||
<script src="{{entire_url('/bricks/bricks.js')}}?v={% if assets_ver %}{{assets_ver()}}{% else %}20260830b{% endif %}"></script>
|
||||
{% for myjs in jsfiles() %}
|
||||
<script src="{{entire_url(myjs)}}{% if assets_ver %}?v={{assets_ver()}}{% endif %}"></script>
|
||||
{% endfor %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user