[hotfix-387] Fix broken toggle (#389)

Closes #387
This commit is contained in:
Adekunle Oduye 2019-10-18 01:37:23 -04:00 committed by Natalie Weizenbaum
parent 46a2d9e3ce
commit 06c5a72833

View File

@ -6,7 +6,7 @@
// Added sticky class when window top is great than nav top
function stickyNav() {
if ($(window).scrollTop() >= sticky.top) {
if (nav.length > 0 && $(window).scrollTop() >= sticky.top) {
$(".sl-l-medium-holy-grail__body").addClass("sl-js-nav--is-sticky");
} else {
$(".sl-l-medium-holy-grail__body").removeClass("sl-js-nav--is-sticky");