[minor] tree, expand on select, dont collapse
This commit is contained in:
parent
6580011f8d
commit
84baa5285d
1 changed files with 6 additions and 5 deletions
|
|
@ -33,7 +33,7 @@ frappe.ui.Tree = Class.extend({
|
|||
toggle: function() {
|
||||
this.get_selected_node().toggle();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
frappe.ui.TreeNode = Class.extend({
|
||||
init: function(args) {
|
||||
|
|
@ -61,9 +61,6 @@ frappe.ui.TreeNode = Class.extend({
|
|||
if(me.tree.toolbar) {
|
||||
me.show_toolbar();
|
||||
}
|
||||
if(me.toggle_on_click) {
|
||||
me.toggle();
|
||||
}
|
||||
if(me.tree.click)
|
||||
me.tree.click(this);
|
||||
})
|
||||
|
|
@ -87,9 +84,13 @@ frappe.ui.TreeNode = Class.extend({
|
|||
$(icon_html + ' <a class="tree-label grey h6">' + this.get_label() + "</a>").
|
||||
appendTo(this.tree_link);
|
||||
|
||||
this.tree_link.find('i, a').click(function() {
|
||||
this.tree_link.find('i').click(function() {
|
||||
setTimeout(function() { me.toolbar.find(".btn-expand").click(); }, 100);
|
||||
});
|
||||
|
||||
this.tree_link.find('a').click(function() {
|
||||
if(!me.expanded) setTimeout(function() { me.toolbar.find(".btn-expand").click(); }, 100);
|
||||
});
|
||||
},
|
||||
get_label: function() {
|
||||
if(this.tree.get_label) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue