fix(tree): change_node_type 死代码导致叶子节点仍显示展开箭头
return 提前返回使 set_url(null) 成为死代码,叶子节点(is_leaf=true)的展开箭头本应隐藏却仍显示。 修复:叶子分支直接 set_url(null) 隐藏箭头,非叶子才 set_state+bind 展开。
This commit is contained in:
parent
cbfe532050
commit
7746595739
@ -103,11 +103,7 @@ bricks.TreeNode = class extends bricks.VBox {
|
||||
}
|
||||
change_node_type(){
|
||||
if (this.is_leaf){
|
||||
this.triple.set_state('close');
|
||||
this.triple.bind('state_changed', this.toggleExpandCollapse.bind(this));
|
||||
return;
|
||||
this.triple.set_url(null);
|
||||
this.triple.unbind('state_changed', this.toggleExpandCollapse.bind(this));
|
||||
} else {
|
||||
this.triple.set_state('close');
|
||||
this.triple.bind('state_changed', this.toggleExpandCollapse.bind(this));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user