Skip to content

Commit

Permalink
[Bugfix] Fix bug where sidebar was not taking all available space wit…
Browse files Browse the repository at this point in the history
…h minHeight set
  • Loading branch information
mauricewijnia committed Jul 30, 2019
1 parent 11089b7 commit 9888383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/resources/js/lib/configure-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
})
}

/**
Expand All @@ -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)`
})
}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/resources/scss/wordpress-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
padding-top: 0;
}
}

// .block-editor__container {
// position: static;
// }
}

.gutenberg__editor.fixed-height {
Expand Down

0 comments on commit 9888383

Please sign in to comment.