diff --git a/CHANGELOG b/CHANGELOG index 4834687cdc..89e6a45856 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Use limit to expand tree * Use spellcheck and lang attributes for textbox widget * Support icon on page * Add keyword attribute to button tag diff --git a/src/view/tree.js b/src/view/tree.js index 7c72f63fa8..cc764eba1b 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -856,9 +856,14 @@ delete this.tree.expanded[this.path]; this.collapse_children(); } else { - this.update_expander(true); - this.tree.expanded[this.path] = this; - this.expand_children(); + if (this.tree.n_children(this) > Sao.config.limit) { + this.tree.screen.set_current_record(this.record); + this.tree.screen.switch_view('form'); + } else { + this.update_expander(true); + this.tree.expanded[this.path] = this; + this.expand_children(); + } } return false; },