|
|
@ -16,6 +16,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
item.setNotSelectedValue(v); |
|
|
|
item.setNotSelectedValue(v); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
@ -31,6 +32,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (BI.isFunction(item.setEnabledValue)) { |
|
|
|
if (BI.isFunction(item.setEnabledValue)) { |
|
|
|
item.setEnabledValue(v); |
|
|
|
item.setEnabledValue(v); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
@ -46,6 +48,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
if (!BI.isFunction(item.setSelected)) { |
|
|
|
item.setValue(v); |
|
|
|
item.setValue(v); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
|
if (BI.deepContains(v, item.getValue())) { |
|
|
@ -61,12 +64,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
v = BI.concat(v, item.getNotSelectedValue()); |
|
|
|
v = BI.concat(v, item.getNotSelectedValue()); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isEnabled() && item.isSelected && !item.isSelected()) { |
|
|
|
if (item.isEnabled() && item.isSelected && !item.isSelected()) { |
|
|
|
v.push(item.getValue()); |
|
|
|
v.push(item.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return v; |
|
|
|
return v; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -75,12 +80,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
v = BI.concat(v, item.getValue()); |
|
|
|
v = BI.concat(v, item.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
|
if (item.isEnabled() && item.isSelected && item.isSelected()) { |
|
|
|
v.push(item.getValue()); |
|
|
|
v.push(item.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return v; |
|
|
|
return v; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -89,12 +96,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
btns = btns.concat(item.getSelectedButtons()); |
|
|
|
btns = btns.concat(item.getSelectedButtons()); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isSelected && item.isSelected()) { |
|
|
|
if (item.isSelected && item.isSelected()) { |
|
|
|
btns.push(item); |
|
|
|
btns.push(item); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return btns; |
|
|
|
return btns; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -103,12 +112,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
btns = btns.concat(item.getNotSelectedButtons()); |
|
|
|
btns = btns.concat(item.getNotSelectedButtons()); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isSelected && !item.isSelected()) { |
|
|
|
if (item.isSelected && !item.isSelected()) { |
|
|
|
btns.push(item); |
|
|
|
btns.push(item); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return btns; |
|
|
|
return btns; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -118,12 +129,14 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
BI.each(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
if (item.isEnabled() && !BI.isFunction(item.setSelected)) { |
|
|
|
leaves = leaves.concat(item.getAllLeaves()); |
|
|
|
leaves = leaves.concat(item.getAllLeaves()); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.isEnabled()) { |
|
|
|
if (item.isEnabled()) { |
|
|
|
leaves.push(item); |
|
|
|
leaves.push(item); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return leaves; |
|
|
|
return leaves; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -133,9 +146,11 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
var vs = item.getValue(); |
|
|
|
var vs = item.getValue(); |
|
|
|
if (item.isEnabled() && (vs === value || BI.contains(vs, value))) { |
|
|
|
if (item.isEnabled() && (vs === value || BI.contains(vs, value))) { |
|
|
|
index = i; |
|
|
|
index = i; |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return index; |
|
|
|
return index; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -145,14 +160,17 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
if (item.isEnabled()) { |
|
|
|
if (item.isEnabled()) { |
|
|
|
if (item.attr("id") === id) { |
|
|
|
if (item.attr("id") === id) { |
|
|
|
node = item; |
|
|
|
node = item; |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} else if (BI.isFunction(item.getNodeById)) { |
|
|
|
} else if (BI.isFunction(item.getNodeById)) { |
|
|
|
if (node = item.getNodeById(id)) { |
|
|
|
node = item.getNodeById(id); |
|
|
|
|
|
|
|
if (node) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return node; |
|
|
|
return node; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -161,15 +179,18 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, { |
|
|
|
BI.any(this.buttons, function (i, item) { |
|
|
|
BI.any(this.buttons, function (i, item) { |
|
|
|
if (item.isEnabled()) { |
|
|
|
if (item.isEnabled()) { |
|
|
|
if (BI.isFunction(item.getNodeByValue)) { |
|
|
|
if (BI.isFunction(item.getNodeByValue)) { |
|
|
|
if (node = item.getNodeByValue(value)) { |
|
|
|
node = item.getNodeByValue(value); |
|
|
|
|
|
|
|
if (node) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (item.attr("value") === value) { |
|
|
|
} else if (item.attr("value") === value) { |
|
|
|
node = item; |
|
|
|
node = item; |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return node; |
|
|
|
return node; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|