diff --git a/static/js/carousel.js b/assets/js/carousel.js similarity index 92% rename from static/js/carousel.js rename to assets/js/carousel.js index 78a51e438e..0e9ce894d2 100644 --- a/static/js/carousel.js +++ b/assets/js/carousel.js @@ -32,8 +32,10 @@ document.addEventListener('DOMContentLoaded', function() { }); const scrolllength = carousel.querySelector('ul li:nth-child(2)').offsetLeft - carousel.querySelector('ul li:nth-child(1)').offsetLeft; const nthchild = (Math.round((ele.scrollLeft/scrolllength)+1)); - carousel.querySelector('ol li:nth-child('+nthchild+')').classList.add('selected'); - carousel.querySelector('ul li:nth-child('+nthchild+')').classList.add('selected'); + let ol_elem = carousel.querySelector('ol li:nth-child('+nthchild+')'); + let ul_elem = carousel.querySelector('ul li:nth-child('+nthchild+')'); + if (ol_elem) { ol_elem.classList.add('selected'); } + if (ul_elem) { ul_elem.classList.add('selected'); } if(carousel.parentElement.parentElement.querySelector('.dynamictitle')) { const title = carousel.querySelector('ul li:nth-child('+nthchild+') img').getAttribute('title'); if(title) carousel.parentElement.parentElement.querySelector('.dynamictitle').innerHTML = title; @@ -97,7 +99,7 @@ document.addEventListener('DOMContentLoaded', function() { } // Add CSS to hide arrows when all elements visible - var styles = "@media (min-width:" + (slides.length * 100 + 400) "px) {#board-carousel { padding: 0 !important; }#board-carousel div.prev, #board-carousel div.next {visibility: hidden;}}" + var styles = "@media (min-width:" + (slides.length * 100 + 400) + "px) {#board-carousel { padding: 0 !important; }#board-carousel div.prev, #board-carousel div.next {visibility: hidden;}}" var styleSheet = document.createElement("style") styleSheet.innerText = styles diff --git a/static/js/tutorials.js b/assets/js/tutorials.js similarity index 100% rename from static/js/tutorials.js rename to assets/js/tutorials.js diff --git a/docs/_index.md b/docs/_index.md index 85aeb00072..49af563d6f 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -216,5 +216,3 @@ sitemap: {{< card link="/tutorials/projects/integrating-viam-with-openai/" class="yellow">}} - - diff --git a/layouts/docs/tutorials.html b/layouts/docs/tutorials.html index 510d360579..34396c144d 100644 --- a/layouts/docs/tutorials.html +++ b/layouts/docs/tutorials.html @@ -80,7 +80,10 @@