Skip to content

Commit

Permalink
Scroll to highlighted AST
Browse files Browse the repository at this point in the history
  • Loading branch information
JennieJi committed Mar 16, 2023
1 parent 4daad6a commit 21ff76e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@
el => el.classList.remove(highlightClassName)
);
message.forEach(line =>
document.getElementsByClassName(`line-${line}`)[0].classList.add(highlightClassName)
document.getElementById(`line-${line}`)?.classList.add(highlightClassName)
);
window.location.href = `#line-${Math.min(...message)}`;
break;
}
}
Expand Down
3 changes: 1 addition & 2 deletions resources/templates/node.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<dl
class="key-{{key}} type-{{type}} child-type-{{childType}} line-{{line}} {{class}}"
data-col-start="{{colStart}}"
data-col-end="{{colEnd}}"
id="line-{{line}}"
>
<dt><span class="key">{{key}}</span><span class="type">{{type}}</span></dt>
<dd class="child">{{child}}</dd>
Expand Down

0 comments on commit 21ff76e

Please sign in to comment.