Skip to content

Commit 6ff99d0

Browse files
authored
Merge pull request #50 from ashwinvis/enh/EnotionZ-scroll
Scroll into view on new text
2 parents 26faf17 + 0f48382 commit 6ff99d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
setDisconnected(false);
3030
socket.on('newContent', function(newHTML) {
3131
document.querySelector(".markdown-body").innerHTML = newHTML;
32+
33+
// scroll to the hyperlink with id="marker"
34+
let marker = document.getElementById("marker");
35+
if(marker) {
36+
marker.scrollIntoView();
37+
}
3238
});
3339
socket.on('die', function(newHTML) {
3440
window.open('', '_self', '');

0 commit comments

Comments
 (0)