From 3196c82be6b34f907b0475db56c33c713d9e070c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 9 Mar 2018 19:14:27 +0100 Subject: [PATCH] Use limit to expand tree The screen switch to the form view if the limit is reached. issue4901 review44021002 --- CHANGELOG | 1 + src/view/tree.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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; },