File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ <h1>Clippy Lints</h1> {# #}
150
150
< h2 class ="panel-title "> {# #}
151
151
< div class ="panel-title-name " id ="lint-{{lint.id}} "> {# #}
152
152
< span > {{lint.id}}</ span > {#+ #}
153
- < a href ="#{{lint.id}} " class ="anchor label label-default "> ¶</ a > {#+ #}
153
+ < a href ="#{{lint.id}} " onclick =" lintAnchor(event) " class ="anchor label label-default "> ¶</ a > {#+ #}
154
154
< a href ="" class ="anchor label label-default " onclick ="copyToClipboard(event) "> {# #}
155
155
📋 {# #}
156
156
</ a > {# #}
Original file line number Diff line number Diff line change @@ -151,6 +151,16 @@ function expandLint(lintId) {
151
151
highlightIfNeeded ( lintId ) ;
152
152
}
153
153
154
+ function lintAnchor ( event ) {
155
+ event . preventDefault ( ) ;
156
+ event . stopPropagation ( ) ;
157
+
158
+ const id = event . target . getAttribute ( "href" ) . replace ( "#" , "" ) ;
159
+ window . location . hash = id ;
160
+
161
+ expandLint ( id ) ;
162
+ }
163
+
154
164
function copyToClipboard ( event ) {
155
165
event . preventDefault ( ) ;
156
166
event . stopPropagation ( ) ;
You can’t perform that action at this time.
0 commit comments