Forráskód Böngészése

fix modern mobile menu

Olivier Massot 5 éve
szülő
commit
a11bc4cfd5

+ 6 - 3
ot_templating/Resources/Public/assets/Modern/script/mega-menu/mega_menu.js

@@ -194,10 +194,13 @@
                             // show drop down
                             drop_down.show(0);
                         } else {
+                            // <--- removed to fix bug where links with subpages are not accessibles in mobile view
                             // remove active class
-                            parents.parent($li).removeClass(activeTriggerMobile);
+                            // parents.parent($li).removeClass(activeTriggerMobile);
                             // hide drop down
-                            drop_down.hide(0);
+                            // drop_down.hide(0);
+                            // ---->
+                            window.location.href = $(this).parent('a').attr('href');
                         }
                         // stop a tag going to anywhere
                         return false;
@@ -411,4 +414,4 @@
         });
     };
     /*global $, jQuery, document*/
-}(jQuery));
+}(jQuery));

+ 16 - 1
ot_templating/Resources/Public/assets/Modern/style/custom.css

@@ -162,14 +162,29 @@
         width: 80%;
     }
 
+    @media screen and (max-width: 900px) {
+        .mega-menu .menu-bar {
+            width: 100%;
+        }
+
+        .mega-menu .drop-down-multilevel {
+            width: 100% !important;
+        }
+    }
+
     .mega-menu > section.menu-list-items .menu-bar {
-        min-height: 90px;
         display: flex;
         flex-direction: row;
         align-items: center;
         justify-content: flex-end;
     }
 
+    @media screen and (min-width: 900px) {
+        .mega-menu > section.menu-list-items .menu-bar {
+            min-height: 90px;
+        }
+    }
+
     .mega-menu .menu-bar a {
         text-align: center;
     }