Commit c5172289 authored by Jen Zajac's avatar Jen Zajac

Fix responsive main menu when in dropdowns mode

  behatnotneeded

  Bug 1465107

  ref: https://css-tricks.com/dangers-stopping-event-propagation/

Change-Id: Ifd7895305ee8aac4c88795ae492a5d2d71fe61c4
parent b868d3d0
......@@ -148,10 +148,11 @@ jQuery(document).ready(function($) {
close_open_menu();
}
});
menu.click(function(e) {
e.stopPropagation();
$(document).on('click', function(event) {
if (!$(event.target).closest('.has-dropdown').length) {
close_open_menu();
}
});
$(document).click(close_open_menu);
// Helper to close any open dropdowns
function close_open_menu() {
......
......@@ -40,7 +40,7 @@
</button>
{/if}
{if $item.submenu}
<ul id="childmenu-{$dwoo.foreach.menu.index}" class="{if $DROPDOWNMENU}has-dropdown{else}hidden-md hidden-lg hidden-sm {if $item.selected}in{/if}{/if} collapse child-nav" role="menu">
<ul id="childmenu-{$dwoo.foreach.menu.index}" class="{if $DROPDOWNMENU}has-dropdown{else}hidden-md hidden-lg hidden-sm{/if}{if $item.selected} in{/if} collapse child-nav" role="menu">
{strip}
{foreach from=$item.submenu item=subitem}
<li class="{if $subitem.selected}active {/if}{if $subitem.submenu}has-sub {/if}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment