mirror of
				https://github.com/slawkens/myaac.git
				synced 2025-11-04 09:46:23 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			716 B
		
	
	
	
		
			Twig
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			716 B
		
	
	
	
		
			Twig
		
	
	
	
	
	
var list = new Array();
 | 
						|
{% set i = 0 %}
 | 
						|
{% for id, cat in config('menu_categories') %}
 | 
						|
	{% if (cat.id != 'shops' or setting('core.gifts_system')) and menus[id]|length > 0 %}
 | 
						|
		list[{{ i }}] = '{{ cat.id }}';
 | 
						|
		{% set i = i + 1 %}
 | 
						|
	{% endif %}
 | 
						|
{% 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();
 | 
						|
}
 |