Skip to content

Commit

Permalink
fix screenshooter resize of paste
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 7, 2024
1 parent b495821 commit 21f23f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions screenshot.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,17 @@ <h1>
});
let height;
const body = document.body;
myCodeMirror.on('change', function() {

myCodeMirror.on('change', adjust_height);
myCodeMirror.on('inputRead', adjust_height);

funtion adjust_height() {
var rect = dialog.getBoundingClientRect();
if (height !== rect.height) {
height = rect.height;
body.style.setProperty('--height', rect.height + 300);
}
});
}
</script>
<footer>
<p>Copyright (c) 2018-2022 <a href="https://jcubic.pl/me">Jakub T. Jankiewicz</a></p>
Expand All @@ -322,4 +326,4 @@ <h1>
</footer>

</body>
</html>
</html>
10 changes: 7 additions & 3 deletions screenshot.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,18 @@ button.addEventListener('click', () => {
});
let height;
const body = document.body;
myCodeMirror.on('change', function() {

myCodeMirror.on('change', adjust_height);
myCodeMirror.on('inputRead', adjust_height);

funtion adjust_height() {
var rect = dialog.getBoundingClientRect();
if (height !== rect.height) {
height = rect.height;
body.style.setProperty('--height', rect.height + 300);
}
});
}
</script>
{{FOOTER}}
</body>
</html>
</html>

0 comments on commit 21f23f6

Please sign in to comment.