File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -293,13 +293,17 @@ <h1>
293
293
} ) ;
294
294
let height ;
295
295
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 ( ) {
297
301
var rect = dialog . getBoundingClientRect ( ) ;
298
302
if ( height !== rect . height ) {
299
303
height = rect . height ;
300
304
body . style . setProperty ( '--height' , rect . height + 300 ) ;
301
305
}
302
- } ) ;
306
+ }
303
307
</ script >
304
308
< footer >
305
309
< p > Copyright (c) 2018-2022 < a href ="https://jcubic.pl/me "> Jakub T. Jankiewicz</ a > </ p >
322
326
</ footer >
323
327
324
328
</ body >
325
- </ html >
329
+ </ html >
Original file line number Diff line number Diff line change @@ -205,14 +205,18 @@ button.addEventListener('click', () => {
205
205
});
206
206
let height;
207
207
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() {
209
213
var rect = dialog.getBoundingClientRect();
210
214
if (height !== rect.height) {
211
215
height = rect.height;
212
216
body.style.setProperty('--height', rect.height + 300);
213
217
}
214
- });
218
+ }
215
219
</script>
216
220
{{FOOTER}}
217
221
</body>
218
- </html>
222
+ </html>
You can’t perform that action at this time.
0 commit comments