bugfix
This commit is contained in:
parent
67923b9079
commit
f34d761407
@ -123,10 +123,15 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
widget.add_widget(this.check_w);
|
widget.add_widget(this.check_w);
|
||||||
this.check_w.bind('changed', this.tree.node_checked.bind(this.tree, this))
|
this.check_w.bind('changed', this.tree.node_checked.bind(this.tree, this))
|
||||||
}
|
}
|
||||||
var icon_url = this.icons_urls.leaf;
|
var icon_url;
|
||||||
|
if ( isString(this.icons_urls){
|
||||||
|
icon_url = this.icons_urls);
|
||||||
|
} else {
|
||||||
|
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 == 'expand') this.icon_url = this.icons_urls.open;
|
||||||
else this.icon_url = this.icons_urls.close;
|
else this.icon_url = this.icons_urls.close;
|
||||||
|
}
|
||||||
var img = new bricks.Svg({
|
var img = new bricks.Svg({
|
||||||
rate:1,
|
rate:1,
|
||||||
url:this.icon_url
|
url:this.icon_url
|
||||||
@ -160,9 +165,9 @@ bricks.TreeNode = class extends bricks.VBox {
|
|||||||
var icons = null;
|
var icons = null;
|
||||||
if (this.tree.node_typeicons){
|
if (this.tree.node_typeicons){
|
||||||
icons = this.tree.node_typeicons[ntype];
|
icons = this.tree.node_typeicons[ntype];
|
||||||
|
if (!icons){
|
||||||
var dt = this.tree.node_typeicons.default_type;
|
var dt = this.tree.node_typeicons.default_type;
|
||||||
if (dt){
|
icons = this.tree.node_typeicons[dt];
|
||||||
icon = this.tree.node_typeicons[dt];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
var bricks = window.bricks || {};
|
var bricks = window.bricks || {};
|
||||||
bricks.bug = false;
|
bricks.bug = false;
|
||||||
|
|
||||||
|
function isString(value) {
|
||||||
|
return typeof value === 'string' || value instanceof String;
|
||||||
|
}
|
||||||
|
|
||||||
function parseRGB(colorStr) {
|
function parseRGB(colorStr) {
|
||||||
const match = colorStr.match(/^rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/);
|
const match = colorStr.match(/^rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/);
|
||||||
if (!match) return null;
|
if (!match) return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user