fix(tree): folder icon now switches to open-folder on expand (typo + this.icon_url bug)
This commit is contained in:
parent
b09ef14301
commit
c98a8b6eeb
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="stylesheet" href="{{entire_url('/bricks/3parties/xterm.css')}}" />
|
<link rel="stylesheet" href="{{entire_url('/bricks/3parties/xterm.css')}}" />
|
||||||
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.css')}}?v=20260815e">
|
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.css')}}?v=20260815f">
|
||||||
<link rel="stylesheet" href="{{entire_url('/bricks/css/api_doc.css')}}">
|
<link rel="stylesheet" href="{{entire_url('/bricks/css/api_doc.css')}}">
|
||||||
{% for mycss in cssfiles() %}
|
{% for mycss in cssfiles() %}
|
||||||
<link rel="stylesheet" href="{{entire_url(mycss)}}">
|
<link rel="stylesheet" href="{{entire_url(mycss)}}">
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<script type="module"
|
<script type="module"
|
||||||
src="{{entire_url('/bricks/3parties/model-viewer.min.js')}}">
|
src="{{entire_url('/bricks/3parties/model-viewer.min.js')}}">
|
||||||
</script>
|
</script>
|
||||||
<script src="{{entire_url('/bricks/bricks.js')}}?v=20260815e"></script>
|
<script src="{{entire_url('/bricks/bricks.js')}}?v=20260815f"></script>
|
||||||
{% for myjs in jsfiles() %}
|
{% for myjs in jsfiles() %}
|
||||||
<script src="{{entire_url(myjs)}}"></script>
|
<script src="{{entire_url(myjs)}}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -77,6 +77,7 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
this.children_loaded = true;
|
this.children_loaded = true;
|
||||||
}
|
}
|
||||||
this.container.show();
|
this.container.show();
|
||||||
|
if (this.icon_w && this.icons_urls.open) this.icon_w.set_url(this.icons_urls.open);
|
||||||
}
|
}
|
||||||
collapse(){
|
collapse(){
|
||||||
this.node_state = 'close'
|
this.node_state = 'close'
|
||||||
@ -84,6 +85,7 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.container.hide();
|
this.container.hide();
|
||||||
|
if (this.icon_w && this.icons_urls.close) this.icon_w.set_url(this.icons_urls.close);
|
||||||
}
|
}
|
||||||
create_triple(){
|
create_triple(){
|
||||||
return new bricks.StatedSvg({
|
return new bricks.StatedSvg({
|
||||||
@ -126,15 +128,14 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
} else {
|
} else {
|
||||||
icon_url = this.icons_urls.leaf;
|
icon_url = this.icons_urls.leaf;
|
||||||
if (this.is_leaf) icon_url = this.icons_urls.leaf;
|
if (this.is_leaf) icon_url = this.icons_urls.leaf;
|
||||||
else if (this.node_state == 'expand') this.icon_url = this.icons_urls.open;
|
else if (this.node_state == 'open') icon_url = this.icons_urls.open;
|
||||||
else this.icon_url = this.icons_urls.close;
|
else icon_url = this.icons_urls.close;
|
||||||
}
|
}
|
||||||
console.log('icons=', this.icons_urls, 'icon_url=', icon_url, this.user_data);
|
this.icon_w = new bricks.Svg({
|
||||||
var img = new bricks.Svg({
|
|
||||||
rate:1,
|
rate:1,
|
||||||
url:icon_url
|
url:icon_url
|
||||||
});
|
});
|
||||||
widget.add_widget(img);
|
widget.add_widget(this.icon_w);
|
||||||
if (this.tree.node_view){
|
if (this.tree.node_view){
|
||||||
this.view_w = await bricks.widgetBuild(this.tree.node_view, widget, this.user_data);
|
this.view_w = await bricks.widgetBuild(this.tree.node_view, widget, this.user_data);
|
||||||
if (this.view_w){
|
if (this.view_w){
|
||||||
@ -171,7 +172,7 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
}
|
}
|
||||||
if (! icons){
|
if (! icons){
|
||||||
icons = {
|
icons = {
|
||||||
open: bricks_resource('imgs/open-folders.svg'),
|
open: bricks_resource('imgs/open-folder.svg'),
|
||||||
close: bricks_resource('imgs/close-folder.svg'),
|
close: bricks_resource('imgs/close-folder.svg'),
|
||||||
leaf: bricks_resource('imgs/close-folder.svg')
|
leaf: bricks_resource('imgs/close-folder.svg')
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user