From 13723fb3c5a462bf7d17cbf14700bdb4e67640a1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Apr 2019 17:45:28 -0400 Subject: [PATCH] highlight current page on side nav --- js/app.js | 12 ++---------- side_nav.php | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/js/app.js b/js/app.js index 0c20be89..b68445b0 100644 --- a/js/app.js +++ b/js/app.js @@ -40,17 +40,9 @@ $('#dT').dataTable( { }); -//Highlight top nav menu item with current page +// Highlight the active nav link on side nav $(function() { - // Highlight the active nav link. var url = window.location.pathname; var filename = url.substr(url.lastIndexOf('/') + 1); - $('.navbar a[href$="' + filename + '"]').parent().addClass("active"); -}); - -$(function() { - // Highlight the active nav link. - var url = window.location.pathname; - var filename = url.substr(url.lastIndexOf('/') + 1); - $('.nav a[href$="' + filename + '"]').parent().addClass("active"); + $('.navbar-nav a[href$="' + filename + '"]').parent().addClass("active"); }); \ No newline at end of file diff --git a/side_nav.php b/side_nav.php index 2c95f1e9..81b9426b 100644 --- a/side_nav.php +++ b/side_nav.php @@ -1,6 +1,6 @@