1. wwuweb
  2. Untitled project
  3. wwuzen

Commits

Max Bronsema  committed 185fb20 Merge

Pulling in Nigel's menu fix.

  • Participants
  • Parent commits 6f491c5, 8b4074e
  • Branches 7.x-dev

Comments (0)

Files changed (2)

File js/script.js

View file
 		attach: function () {
 
 			$('.mobile-main-nav').click(function () {
-				var mainMenu = $('.main-nav .menu');
+				// target all unordered lists in .main-nav
+				var mainMenu = $('.main-nav div > ul');
+				var subMenus = $('.main-nav div > ul ul');
 
 				if (mainMenu.is(':visible')) {
+					mainMenu.css('display', 'block');
 					mainMenu.slideToggle();
 				} else {
 					mainMenu.slideToggle(400, function() {
 						if (mainMenu.is(':visible')) {
 							mainMenu.css('display', 'table');
+							subMenus.css('display', 'table');
 						}
 					});
 				}
 	// START MENU EXPANSION CODE
 	Drupal.behaviors.menuExpansion = {
 		attach: function () {
+		
 		$(".expanded").click(function(e) {
-		  if ($(this).hasClass("opened")) {
-		    $(this).children().children().hide();
-		    //$(this).parent().children().show();
-		    $(this).removeClass("opened");
-		    // Close all children as well
-		    var x = $(this).children().children("li");
-		    while (x.size() > 0) {
-	      	x.removeClass("opened");
-	      	x.children().children().hide();
-	      	x = x.children().children("li");
-	    	}
-	   	} else {
-	     	$(this).children().children().show();
-	     	$(this).parent().children().not(this).removeClass("opened");
-	     	$(this).parent().children().not(this).children().children().hide();
-	     	$(this).addClass("opened");
-	   	}
-		  e.stopPropagation();
+			if ($(this).hasClass("opened")) {
+				$(this).children().children().hide();
+				$(this).removeClass("opened");
+
+				// Close all children as well
+				var x = $(this).children().children("li");
+		    
+				while (x.size() > 0) {
+	      				x.removeClass("opened");
+	      				x.children().children().hide();
+	      				x = x.children().children("li");
+	    			}
+
+	   		} else {
+	     			$(this).children().children().show();
+	     			$(this).parent().children().not(this).removeClass("opened");
+	     			$(this).parent().children().not(this).children().children().hide();
+	     			$(this).addClass("opened");
+	   		}
+		  
+			e.stopPropagation();
 		});
 
 	// END MENU EXPANSION CODE

File sass/layouts/responsive-sidebars.scss

View file
         li {
           @include transition(.25s);
           width: 100%;
+	  float: none;
           text-align: left;
           display:block;
           border-top:solid 1px white;
             @include transition(1s);
             text-decoration:none;
             color:#fff;
-            padding: .7em 0 .65em 1em;
+            padding: .7em 1em .65em 1em;
             display:block;
             cursor:pointer;
-            width:100%;
+            width: auto;
             /* &:hover, &:focus, &:active {
               @include transition(.2s);
             } */
           }
-          &.is-expanded { cursor:s-resize; }
-          &.is-expanded > a { width: calc(100% - 58px); }
+          &.is-expanded {
+		 cursor:s-resize;
+		 -moz-box-sizing: border-box;
+		 box-sizing: border-box;
+		 padding-right: 44px;
+	  	.is-expanded {
+			-moz-box-sizing: content-box;
+			box-sizing: content-box;			
+		}
+	  }
+          &.is-expanded > a {
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+	  }
           &.is-expanded.opened { cursor:n-resize; }
           ul {
             padding-left:0;
             } // End li
           } // End ul
         } // End li
-        li.expanded .menu li { display: none; }
+        li.expanded .menu li {
+		 display: none;
+		 padding-right: 44px;
+		 a {
+			position: relative;
+			right: -44px;
+			margin-left: -44px;
+		 }
+	}
+	li.expanded .menu li.is-expanded > a {
+		position: static;
+		margin-left: 0;
+	}
       } // End .menu
     } // End .main-nav
   @mixin nav-icons($fileName) { background-image:url("../../images/icons/#{$fileName}.png"); }