highlight current page sidelinks
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 22 Feb 2016 20:30:21 +0000 (15:30 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 22 Feb 2016 20:30:21 +0000 (15:30 -0500)
css/app.css
js/app.js
js/custom/pageSetup.js
scss/_sidebar.scss

index b101df1..2db7b7e 100644 (file)
@@ -7360,6 +7360,9 @@ article {
 .current_page_item a {
   font-weight: bold; }
 
+.current {
+  color: #57b649 !important; }
+
 .search-top #searchform {
   text-align: left;
   display: inline-block;
index dbcbc37..df0a835 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -31,29 +31,6 @@ $(document).ready(function () {
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
     });
-//        var blocks = {
-//          init: function (){
-//              this.bindEvents();
-//        },
-//        bindEvents: function (){
-//           $('#block-1, #block-2, #block-3, #block-4').bind('click tap', function(){
-//                if($(window).width() <= 1024){
-//                    $(this).toggleClass('front-page-blocks');
-//                }
-//            });
-//            $('#block-1, #block-2, #block-3, #block-4').on("mouseover", function (){
-//                if($(window).width() > 1024){
-//                    $(this).addClass('front-page-blocks');
-//                }
-//            });
-//            $('#block-1, #block-2, #block-3, #block-4').on("mouseout", function (){
-//                if($(window).width() > 1024){
-//                    $(this).removeClass('front-page-blocks');
-//                }
-//            });
-//        }
-//    };
-//        blocks.init();
     $("#searchIcon").click(function(){
         if($("#topSearchForm").css("display") == "none"){
 //           $("#searchform").css("display", "inline");
@@ -80,4 +57,18 @@ $(document).ready(function () {
     
     // remove drop down arrow icons from sub menu items
     $("#menu-menu-1").find(".dropdown").children("li").removeClass("has-dropdown");
+    
+    // remove #/gallery/recent from url to track current page
+    var url = window.location.href.replace("#/gallery/recent", "");
+
+    // 'current' class style to sidebar item that matches the current url
+      $('#side-links ul.sidebar li a').each(function() {
+        if ($(this).prop('href') == url) {
+            $(this).addClass('current');
+        }
+        if($(this).attr("class") === "current"){
+            $(this).parent("li").addClass("current");
+        }
+    });
+   
 });
index 1a33cf8..3ea64ea 100644 (file)
@@ -22,29 +22,6 @@ $(document).ready(function () {
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
     });
-//        var blocks = {
-//          init: function (){
-//              this.bindEvents();
-//        },
-//        bindEvents: function (){
-//           $('#block-1, #block-2, #block-3, #block-4').bind('click tap', function(){
-//                if($(window).width() <= 1024){
-//                    $(this).toggleClass('front-page-blocks');
-//                }
-//            });
-//            $('#block-1, #block-2, #block-3, #block-4').on("mouseover", function (){
-//                if($(window).width() > 1024){
-//                    $(this).addClass('front-page-blocks');
-//                }
-//            });
-//            $('#block-1, #block-2, #block-3, #block-4').on("mouseout", function (){
-//                if($(window).width() > 1024){
-//                    $(this).removeClass('front-page-blocks');
-//                }
-//            });
-//        }
-//    };
-//        blocks.init();
     $("#searchIcon").click(function(){
         if($("#topSearchForm").css("display") == "none"){
 //           $("#searchform").css("display", "inline");
@@ -71,4 +48,18 @@ $(document).ready(function () {
     
     // remove drop down arrow icons from sub menu items
     $("#menu-menu-1").find(".dropdown").children("li").removeClass("has-dropdown");
+    
+    // remove #/gallery/recent from url to track current page
+    var url = window.location.href.replace("#/gallery/recent", "");
+
+    // 'current' class style to sidebar item that matches the current url
+      $('#side-links ul.sidebar li a').each(function() {
+        if ($(this).prop('href') == url) {
+            $(this).addClass('current');
+        }
+        if($(this).attr("class") === "current"){
+            $(this).parent("li").addClass("current");
+        }
+    });
+   
 });
index 985616e..2616d14 100644 (file)
 }
 .current_page_item a {
     font-weight: bold;
+}
+.current{
+    color: $green !important;
 }
\ No newline at end of file