diff --git a/src/www/head.inc b/src/www/head.inc index f9f7ff4b2..351a140dd 100644 --- a/src/www/head.inc +++ b/src/www/head.inc @@ -147,11 +147,13 @@ $pagetitle = gentitle( $pgtitle ); // hide submenu items $('#mainmenu .list-group-item').click(function(){ - $('#mainmenu .list-group-item').each(function(){ - if ($(this).attr('aria-expanded') == 'true' && $(this).data('parent') != '#mainmenu' && $(this).attr('href').substring(0,1) != '#') { - $("#"+$(this).attr('href').substring(1,999)).collapse('hide'); - } - }); + if($(this).attr('href').substring(0,1) == '#') { + $('#mainmenu .list-group-item').each(function(){ + if ($(this).attr('aria-expanded') == 'true' && $(this).data('parent') != '#mainmenu') { + $("#"+$(this).attr('href').substring(1,999)).collapse('hide'); + } + }); + } }); });