Skip to content

Commit

Permalink
Merge pull request #884 from pressbooks/pb-876-parsing-error
Browse files Browse the repository at this point in the history
ToC Toggle Button A11y Fix
  • Loading branch information
arzola authored Oct 29, 2021
2 parents 2942e93 + f2cb355 commit eb4c9d1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions assets/src/scripts/routes/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
)
.prop( 'hidden', false );
} );
$target.parents( '.toc__toggle' ).attr( 'aria-expanded', 'true' );
$target.parents( '.toc__toggle' ).attr( 'data-expanded', 'true' );
} );

$( document.body ).on( 'click', '.toc__toggle #hide', function ( e ) {
Expand All @@ -36,7 +36,7 @@ export default {
)
.attr( 'hidden', 'true' );
} );
$target.parents( '.toc__toggle' ).attr( 'aria-expanded', 'false' );
$target.parents( '.toc__toggle' ).attr( 'data-expanded', 'false' );
} );
} );
},
Expand Down
8 changes: 4 additions & 4 deletions assets/src/styles/components/_toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ $light: #eee;
text-align: center;
}

.toc__toggle[aria-expanded="false"] #hide {
.toc__toggle[data-expanded="false"] #hide {
display: none;
}

.toc__toggle[aria-expanded="false"] #show {
.toc__toggle[data-expanded="false"] #show {
display: inline-block;
}

.toc__toggle[aria-expanded="true"] #hide {
.toc__toggle[data-expanded="true"] #hide {
display: inline-block;
}

.toc__toggle[aria-expanded="true"] #show {
.toc__toggle[data-expanded="true"] #show {
display: none;
}

Expand Down
4 changes: 2 additions & 2 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"/scripts/book.js": "/scripts/book.js?id=e66e96b2f7d5e73debc8",
"/scripts/book.js": "/scripts/book.js?id=e9e6c9579c3aa2a2b5f7",
"/scripts/pane.js": "/scripts/pane.js?id=7e5b385cb135973c79f7",
"/scripts/collapse-sections.js": "/scripts/collapse-sections.js?id=b902d882dd21410b4387",
"/scripts/lightbox.js": "/scripts/lightbox.js?id=cb2b7b2a5fb303c3095d",
"/styles/book.css": "/styles/book.css?id=9a868437441809f4adb8",
"/styles/book.css": "/styles/book.css?id=c427332d12f4f3dab967",
"/styles/web-house-style.css": "/styles/web-house-style.css?id=f2ec506de7eae2e9ddc5",
"/scripts/sharer.js": "/scripts/sharer.js?id=726d50806d381e7cf7d0",
"/scripts/lity.js": "/scripts/lity.js?id=b91ed0405760d2e124c1",
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts/book.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scripts/sharer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eb4c9d1

Please sign in to comment.