From f0d1398b0d1b1a7c5bd1d4e0b3488b7f1aa74364 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Tue, 23 Feb 2021 19:39:16 -0500 Subject: Big rework of the directory structure to make it more orderly for my brain --- frontend/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'frontend/index.js') diff --git a/frontend/index.js b/frontend/index.js index f481bc6..d14ca95 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -2,8 +2,13 @@ (function() { function main() { - const lPathName = window.location.pathname.length > 1 && window.location.pathname.startsWith('/') ? window.location.pathname.substr(1) : window.location.pathname; - $('nav').find('a[href="' + lPathName + '"').addClass('nav-selected'); + + $.get('/navbar.html', function(pData) { + $('nav').html(pData); + + const lPathName = window.location.pathname.length > 1 && window.location.pathname.startsWith('/') ? window.location.pathname.substr(1) : window.location.pathname; + $('nav').find('a[href="' + lPathName + '"').addClass('nav-selected'); + }); } $(document).ready(main); -- cgit v1.2.1