From 98883834cdd2d22c088eea38bf1b72af2d75e2fa Mon Sep 17 00:00:00 2001 From: Maurice Wijnia Date: Tue, 30 Jul 2019 16:06:33 +0200 Subject: [PATCH] [Bugfix] Fix bug where sidebar was not taking all available space with minHeight set --- src/resources/js/lib/configure-editor.js | 13 ++++++++----- src/resources/scss/wordpress-overrides.scss | 4 ---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/resources/js/lib/configure-editor.js b/src/resources/js/lib/configure-editor.js index ac491385..2f11b331 100644 --- a/src/resources/js/lib/configure-editor.js +++ b/src/resources/js/lib/configure-editor.js @@ -57,10 +57,11 @@ function disableWPBlocks () { */ function setMaxHeight (maxHeight) { const editor = window.Laraberg.editor - const editPostLayout = editor.querySelector('.edit-post-layout__content') - editor.style.maxHeight = maxHeight - editPostLayout.style.maxHeight = `calc(${maxHeight} - 56px)` + + elementRendered('.edit-post-layout__content', (el) => { + el.style.minHeight = `calc(${maxHeight} - 56px)` + }) } /** @@ -69,9 +70,11 @@ function setMaxHeight (maxHeight) { */ function setMinHeight (minHeight) { const editor = window.Laraberg.editor - const sidebar = editor.querySelector('.edit-post-sidebar') editor.style.minHeight = minHeight - sidebar.style.minHeight = `calc(${minHeight} - 56px)` + + elementRendered('.edit-post-sidebar', (el) => { + el.style.minHeight = `calc(${minHeight} - 56px)` + }) } /** diff --git a/src/resources/scss/wordpress-overrides.scss b/src/resources/scss/wordpress-overrides.scss index cc13e200..6d37dfa5 100644 --- a/src/resources/scss/wordpress-overrides.scss +++ b/src/resources/scss/wordpress-overrides.scss @@ -45,10 +45,6 @@ padding-top: 0; } } - - // .block-editor__container { - // position: static; - // } } .gutenberg__editor.fixed-height {