From b9b40363afbac24af38cddf41cbb1895b78cbe1b Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Sun, 7 Jan 2024 22:29:32 +0100 Subject: [PATCH] fix screenshooter resize of paste --- screenshot.html | 10 +++++++--- screenshot.tmpl | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/screenshot.html b/screenshot.html index b9bd3a422..d8e8fb324 100644 --- a/screenshot.html +++ b/screenshot.html @@ -293,13 +293,17 @@

}); let height; const body = document.body; -myCodeMirror.on('change', function() { + +//myCodeMirror.on('change', adjust_height); +myCodeMirror.on('update', adjust_height); + +function adjust_height() { var rect = dialog.getBoundingClientRect(); if (height !== rect.height) { height = rect.height; body.style.setProperty('--height', rect.height + 300); } -}); +} - \ No newline at end of file + diff --git a/screenshot.tmpl b/screenshot.tmpl index fcebefca5..85db9c75a 100644 --- a/screenshot.tmpl +++ b/screenshot.tmpl @@ -205,14 +205,18 @@ button.addEventListener('click', () => { }); let height; const body = document.body; -myCodeMirror.on('change', function() { + +//myCodeMirror.on('change', adjust_height); +myCodeMirror.on('update', adjust_height); + +function adjust_height() { var rect = dialog.getBoundingClientRect(); if (height !== rect.height) { height = rect.height; body.style.setProperty('--height', rect.height + 300); } -}); +} {{FOOTER}} - \ No newline at end of file +