fix fitToContent when applies-to is taller than window

This commit is contained in:
tophf 2020-11-13 18:59:59 +03:00
parent 001b8c6166
commit 184b6d4f7c

View File

@ -160,7 +160,8 @@ function SectionsEditor() {
contentHeight += 9; // border & resize grip
cm.off('update', resize);
const cmHeight = wrapper.offsetHeight;
const maxHeight = (window.innerHeight - headerOffset) - (section.el.offsetHeight - cmHeight);
const appliesToHeight = Math.min(section.el.offsetHeight - cmHeight, window.innerHeight / 2);
const maxHeight = (window.innerHeight - headerOffset) - appliesToHeight;
const fit = Math.min(contentHeight, maxHeight);
if (Math.abs(fit - cmHeight) > 1) {
cm.setSize(null, fit);