changeset db82cdef5541 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=db82cdef5541
description:
Use modal body maximum height to compute treeview height
issue9551
review314171002
diffstat:
src/view/tree.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (23 lines):
diff -r 41ebb700348d -r db82cdef5541 src/view/tree.js
--- a/src/view/tree.js Sat Sep 12 10:41:34 2020 +0200
+++ b/src/view/tree.js Sat Sep 12 18:28:22 2020 +0200
@@ -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);
}