Open lint when clicking on its anchor
This commit is contained in:
parent
b33977b852
commit
7115404a97
@ -150,7 +150,7 @@ Otherwise, have a great day =^.^=
|
||||
<h2 class="panel-title"> {# #}
|
||||
<div class="panel-title-name" id="lint-{{lint.id}}"> {# #}
|
||||
<span>{{lint.id}}</span> {#+ #}
|
||||
<a href="#{{lint.id}}" class="anchor label label-default">¶</a> {#+ #}
|
||||
<a href="#{{lint.id}}" onclick="lintAnchor(event)" class="anchor label label-default">¶</a> {#+ #}
|
||||
<a href="" class="anchor label label-default" onclick="copyToClipboard(event)"> {# #}
|
||||
📋 {# #}
|
||||
</a> {# #}
|
||||
|
@ -151,6 +151,16 @@ function expandLint(lintId) {
|
||||
highlightIfNeeded(lintId);
|
||||
}
|
||||
|
||||
function lintAnchor(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const id = event.target.getAttribute("href").replace("#", "");
|
||||
window.location.hash = id;
|
||||
|
||||
expandLint(id);
|
||||
}
|
||||
|
||||
function copyToClipboard(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
Loading…
Reference in New Issue
Block a user