scroll to top of overlay
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 16 Apr 2018 19:15:01 +0000 (15:15 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 16 Apr 2018 19:15:01 +0000 (15:15 -0400)
scroll top top of off canvas menu on sub menu click

css/app.css
js/app.js
js/custom/pageSetup.js
scss/_off-canvas.scss

index 5e15162..3bebe16 100644 (file)
@@ -8072,7 +8072,7 @@ aside.oc-overlay {
   overflow-y: scroll;
   bottom: 0;
   background-color: white;
-  z-index: 2;
+  z-index: 11;
   cursor: pointer; }
 
 aside.oc-overlay li.page_item {
index fb745e0..a1fec59 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -30,20 +30,7 @@ $(document).ready(function () {
        if( $(this).children('ul').length > 0 ){
            let menuParent = $(this).parent();
   
-
-
-
-
-
-
-
-
-
            $(this).on("click", function(e){
-               // if( $(this).parent().hasClass('children') ){
-               //     console.log("yes");
-               // }
-
                // collapse the nav menu that isn't in focus (primary or secondary)
                other_menu.toggleClass("oc-hidden");
 
@@ -53,25 +40,16 @@ $(document).ready(function () {
                // problem is here, this is a blanket toggle which affects sub menus unintentionally
                $(this).children('a').siblings('ul').toggleClass('oc-open');
 
-               // $(this).children('a').siblings('ul').toggleClass('oc-hidden');
-
                // For animation purposes
                $(this).toggleClass('oc-expanded');
                $(this).siblings().toggleClass("oc-collapsed");
+               $('.oc-overlay').animate({ scrollTop: 0 }, "slow");
            })
 
            $(this).children('a').on('click', function(e){
                e.preventDefault();
            })
 
-
-
-
-
-
-
-
-
        } else {
            let url = $(this).children('a').attr('href');
            $(this).on("click", function(){
index a5da603..1710408 100644 (file)
@@ -21,20 +21,7 @@ $(document).ready(function () {
        if( $(this).children('ul').length > 0 ){
            let menuParent = $(this).parent();
   
-
-
-
-
-
-
-
-
-
            $(this).on("click", function(e){
-               // if( $(this).parent().hasClass('children') ){
-               //     console.log("yes");
-               // }
-
                // collapse the nav menu that isn't in focus (primary or secondary)
                other_menu.toggleClass("oc-hidden");
 
@@ -44,25 +31,16 @@ $(document).ready(function () {
                // problem is here, this is a blanket toggle which affects sub menus unintentionally
                $(this).children('a').siblings('ul').toggleClass('oc-open');
 
-               // $(this).children('a').siblings('ul').toggleClass('oc-hidden');
-
                // For animation purposes
                $(this).toggleClass('oc-expanded');
                $(this).siblings().toggleClass("oc-collapsed");
+               $('.oc-overlay').animate({ scrollTop: 0 }, "slow");
            })
 
            $(this).children('a').on('click', function(e){
                e.preventDefault();
            })
 
-
-
-
-
-
-
-
-
        } else {
            let url = $(this).children('a').attr('href');
            $(this).on("click", function(){
index 2cf4789..cdf2fe8 100644 (file)
@@ -12,7 +12,7 @@ aside.oc-overlay {
     overflow-y: scroll;
     bottom: 0;
     background-color: white;
-    z-index: 2;
+    z-index: 11;
     cursor: pointer;
 }
 aside.oc-overlay li.page_item {