Skip to content

Commit

Permalink
Pre-commit fixes
Browse files Browse the repository at this point in the history
Pre-commit hook was not installed yet, so had to run it manually.
  • Loading branch information
koopmant committed Oct 14, 2024
1 parent 6aaf5a2 commit 27cab7e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions app/grandchallenge/core/static/js/markdownx_full_page.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
$('document').ready(function(){
$("document").ready(() => {
// Sync the height of the preview element to the height of the editor element.
let ELEMENTS = document.getElementsByClassName('markdownx');
Object.values(ELEMENTS).map(function (element) {
let editor = element.querySelector('.markdownx-editor'), preview = element.querySelector('.markdownx-preview');
preview.style.height = editor.clientHeight + "px";
const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
if (entry.contentBoxSize) {
preview.style.height = editor.clientHeight + "px";
const ELEMENTS = document.getElementsByClassName("markdownx");
Object.values(ELEMENTS).map(element => {
const editor = element.querySelector(".markdownx-editor");
const preview = element.querySelector(".markdownx-preview");
preview.style.height = `${editor.clientHeight}px`;
const resizeObserver = new ResizeObserver(entries => {
for (const entry of entries) {
if (entry.contentBoxSize) {
preview.style.height = `${editor.clientHeight}px`;
}
}
}
});
resizeObserver.observe(editor);
});
Expand Down

0 comments on commit 27cab7e

Please sign in to comment.