From 2d3374b8730ea80f0a57d679327f447ea26f6ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 12 Sep 2020 18:28:22 +0200 Subject: [PATCH] Use modal body maximum height to compute treeview height issue9551 review314171002 --- src/view/tree.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/tree.js b/src/view/tree.js index 2a8f6c0ef1..2353c47eb2 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -19,6 +19,10 @@ var height = ''; if (!el.parents('.form').length && !el.parents('#menu').length) { + var vh = '100vh'; + if (el.parents('.modal-body').length) { + vh = el.parents('.modal-body').css('max-height'); + } var padding = ' '; el.parents('.panel-body').each(function(i, panel) { panel = jQuery(panel); @@ -37,7 +41,7 @@ } }); var y = el[0].getBoundingClientRect().y; - height = 'calc(100vh - ' + y + 'px' + padding + box_shadow + ')'; + height = 'calc(' + vh + ' - ' + y + 'px' + padding + box_shadow + ')'; } el.css('height', height); }