Skip to content

Commit b9b4036

Browse files
committed
fix screenshooter resize of paste
1 parent b495821 commit b9b4036

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

screenshot.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,17 @@ <h1>
293293
});
294294
let height;
295295
const body = document.body;
296-
myCodeMirror.on('change', function() {
296+
297+
//myCodeMirror.on('change', adjust_height);
298+
myCodeMirror.on('update', adjust_height);
299+
300+
function adjust_height() {
297301
var rect = dialog.getBoundingClientRect();
298302
if (height !== rect.height) {
299303
height = rect.height;
300304
body.style.setProperty('--height', rect.height + 300);
301305
}
302-
});
306+
}
303307
</script>
304308
<footer>
305309
<p>Copyright (c) 2018-2022 <a href="https://jcubic.pl/me">Jakub T. Jankiewicz</a></p>
@@ -322,4 +326,4 @@ <h1>
322326
</footer>
323327

324328
</body>
325-
</html>
329+
</html>

screenshot.tmpl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,18 @@ button.addEventListener('click', () => {
205205
});
206206
let height;
207207
const body = document.body;
208-
myCodeMirror.on('change', function() {
208+
209+
//myCodeMirror.on('change', adjust_height);
210+
myCodeMirror.on('update', adjust_height);
211+
212+
function adjust_height() {
209213
var rect = dialog.getBoundingClientRect();
210214
if (height !== rect.height) {
211215
height = rect.height;
212216
body.style.setProperty('--height', rect.height + 300);
213217
}
214-
});
218+
}
215219
</script>
216220
{{FOOTER}}
217221
</body>
218-
</html>
222+
</html>

0 commit comments

Comments
 (0)