We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9c1b6f commit 7022293Copy full SHA for 7022293
src/main/resources/META-INF/resources/frontend/code-viewer.ts
@@ -449,12 +449,16 @@ pre[class*="language-"] {
449
div.style.top= `calc( ${top}px + 0.75em)`;
450
div.style.height= `${height}px`;
451
452
- //scroll to the begin of the marked block
453
- if ((begin as any).scrollIntoViewIfNeeded) {
454
- (begin as any).scrollIntoViewIfNeeded();
455
- } else {
456
- (begin as any).scrollIntoView()
+ const scrollIntoView = elem => {
+ if ((elem as any).scrollIntoViewIfNeeded) {
+ (elem as any).scrollIntoViewIfNeeded();
+ } else {
+ (elem as any).scrollIntoView()
457
+ }
458
}
459
+
460
+ scrollIntoView(end);
461
+ scrollIntoView(begin);
462
463
464
0 commit comments