Skip to content

Commit

Permalink
Add test for index (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb authored Apr 15, 2020
1 parent a289432 commit bfa9972
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/static/js/chapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ function indexHighlighter() {

var chapterIndex = document.querySelector('.index-box');

// If not index - then nothing to do!
if (!chapterIndex) {
return;
}

// Check if user has set reduced motion and only continue if not
var hasOSReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (hasOSReducedMotion) {
Expand Down

0 comments on commit bfa9972

Please sign in to comment.