Commit de21708 Tony Sansone
committed
1 parent 779e378 commit de21708 Copy full SHA for de21708
File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ main .content {
297
297
margin-left : - ($icon-size + $anchor-padding );
298
298
padding-right : $anchor-padding ;
299
299
overflow : hidden ;
300
-
300
+
301
301
.octicon-link {
302
302
@include transition (.1s );
303
303
@@ -317,7 +317,7 @@ main .content {
317
317
}
318
318
319
319
& :focus .octicon-link {
320
- opacity : 1
320
+ opacity : 1 ;
321
321
}
322
322
}
323
323
@@ -331,6 +331,7 @@ main .content {
331
331
& [id ] {
332
332
scroll-margin : 60px ;
333
333
}
334
+
334
335
}
335
336
336
337
// Push # link targets clear of page header.
Original file line number Diff line number Diff line change @@ -124,6 +124,19 @@ function adjustToc() {
124
124
$ ( document . body ) . scrollspy ( { offset : 100 , target : '#site-toc--side' } ) ;
125
125
}
126
126
127
+ function adjustHeadingAnchors ( ) {
128
+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
129
+ const headingAnchors = document . querySelectorAll ( 'a.anchor[aria-hidden]' ) ;
130
+ // const headingAnchors = document.querySelectorAll('span.octicon-link');
131
+ // const headingAnchors = document.querySelectorAll('h2[id]');
132
+ console . log ( headingAnchors )
133
+ headingAnchors . forEach ( element => {
134
+ // element.setAttribute('aria-disabled', 'true');
135
+ element . setAttribute ( 'tabindex' , '-1' ) ;
136
+ } ) ;
137
+ } ) ;
138
+ }
139
+
127
140
function createGallery ( ) {
128
141
for ( let i = 0 ; i < arguments . length ; i ++ ) {
129
142
const galleryName = arguments [ i ] ;
@@ -241,4 +254,7 @@ $(function() {
241
254
}
242
255
} ) ;
243
256
257
+
244
258
} ) ;
259
+
260
+ adjustHeadingAnchors ( ) ; // Disable ARIA for copyable anchor links
You can’t perform that action at this time.
0 commit comments