Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
fix: fix issue with scrollIntoView
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaskarmelkani committed Jun 22, 2017
1 parent 0c5c33d commit b8628db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/script/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
var atRoot = location.pathname === '/' || location.pathname === '/index.html';
if (!atRoot || location.hash !== '') {
// hexo rewrites the URLs to be relative, so the current page has href="".
document.querySelector('.item-toc a[href=""]').scrollIntoView();
document.querySelector('.item-toc a[href=""]') && document.querySelector('.item-toc a[href=""]').scrollIntoView();
}

// version select
Expand Down

0 comments on commit b8628db

Please # to comment.