File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/routes/tutorial/[slug] Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 107
107
}
108
108
109
109
onMount (() => {
110
+ function on_iframe_load () {
111
+ iframe .classList .add (' loaded' );
112
+ }
110
113
function destroy () {
114
+ iframe .removeEventListener (' load' , on_iframe_load);
111
115
if (adapter) {
112
116
adapter .destroy ();
113
117
}
114
118
}
115
119
116
120
document .addEventListener (' pagehide' , destroy);
121
+ iframe .addEventListener (' load' , on_iframe_load);
117
122
return destroy;
118
123
});
119
124
317
322
// change the src without adding a history entry, which
318
323
// would make back/forward traversal very annoying
319
324
const parentNode = /** @type {HTMLElement} */ (iframe .parentNode );
325
+ iframe .classList .remove (' loaded' );
320
326
parentNode? .removeChild (iframe);
321
327
iframe .src = src;
322
328
parentNode? .appendChild (iframe);
497
503
.content {
498
504
display: flex;
499
505
flex- direction: column;
506
+ position: relative;
500
507
min- height: 0 ;
501
508
height: 100 % ;
502
509
max- height: 100 % ;
539
546
flex- direction: column;
540
547
}
541
548
542
- .content {
543
- position: relative;
544
- }
545
-
546
549
iframe {
547
550
width: 100 % ;
548
551
height: 100 % ;
553
556
background: var (-- sk- back- 2 );
554
557
}
555
558
559
+ iframe: not (.loaded ) {
560
+ display: none;
561
+ }
562
+
556
563
.editor - container {
557
564
position: relative;
558
565
background- color: var (-- sk- back- 3 );
You can’t perform that action at this time.
0 commit comments