myaac/templates/kathrine/menu.js.html.twig
slawkens 6c9e09ea73 * moved template menus to database, they're now dynamically loaded
* you can edit them in Admin Panel under 'Menus' option.
* you can also add custom links, like http://google.pl
* removed videos pages, as it can be easily added using custom Menus and Pages with insert Media
* removed bug_report configurable, its now enabled by default
2017-10-24 14:42:23 +02:00

33 lines
658 B
Twig

var list = new Array();
{% set i = 0 %}
{% for cat in categories %}
{% if cat.id != 'shops' or config.gifts_system %}
list[{{ i }}] = '{{ cat.id }}';
{% endif %}
{% set i = i + 1 %}
{% endfor %}
function initMenu()
{
var length = list.length;
for(i = 0; i < length; i++)
{
if(list[i] == category)
{
document.getElementById(list[i]).className = 'tab-active';
document.getElementById(list[i] + "-submenu").style.display = 'block';
}
else
{
document.getElementById(list[i]).className = 'tab';
document.getElementById(list[i] + "-submenu").style.display = 'none';
}
}
}
function menuSwitch(cat)
{
category = cat;
initMenu();
}