PageSourceSearch

https://www.metro-nom.eu/themes/theme940/js/modules/blocktopmenu/js/blocktopmenu.js

js metro-nom.eu collected 2026-10-10 01:24:07 UTC 3,103 bytes, 108 lines download raw bytes

1/*
2* 2007-2014 PrestaShop
3*
4* NOTICE OF LICENSE
5*
6* This source file is subject to the Academic Free License (AFL 3.0)
7* that is bundled with this package in the file LICENSE.txt.
8* It is also available through the world-wide-web at this URL:
9* http://opensource.org/licenses/afl-3.0.php
10* If you did not receive a copy of the license and are unable to
11* obtain it through the world-wide-web, please send an email
12* to [email protected] so we can send you a copy immediately.
13*
14* DISCLAIMER
15*
16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17* versions in the future. If you wish to customize PrestaShop for your
18* needs please refer to http://www.prestashop.com for more information.
19*
20*  @author PrestaShop SA <[email protected]>
21*  @copyright  2007-2014 PrestaShop SA
22*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23*  International Registered Trademark & Property of PrestaShop SA
24*/
25
26var responsiveflagMenu = false;
27var categoryMenu = $('ul.sf-menu');
28var mCategoryGrover = $('.sf-contener .cat-title');
29
30$(document).ready(function(){
31	responsiveMenu();
32	$(window).resize(responsiveMenu);
33});
34
35// check resolution
36function responsiveMenu()
37{
38   if ($(document).width() <= 1229 && responsiveflagMenu == false)
39	{
40		menuChange('enable');
41		responsiveflagMenu = true;
42	}
43	else if ($(document).width() >= 1230)
44	{
45		menuChange('disable');
46		responsiveflagMenu = false;
47	}
48}
49
50// init Super Fish Menu for 767px+ resolution
51function desktopInit()
52{
53	mCategoryGrover.off();
54	mCategoryGrover.removeClass('active');
55	$('.sf-menu > li > ul').removeClass('menu-mobile').parent().find('.menu-mobile-grover').remove();
56	$('.sf-menu').removeAttr('style');
57	categoryMenu.superfish('init');
58	$('.sf-menu > li > ul').addClass('submenu-container clearfix'); //add class for width define
59	i = 0;
60	$('.sf-menu > li > ul > li:not(#category-thumbnail)').each(function(){  //add classes for clearing
61		i++;
62		if(i%2 == 1)
63			$(this).addClass('first-in-line-xs');
64		else if (i%5 == 1)
65			$(this).addClass('first-in-line-lg');
66	});
67}
68
69function mobileInit()
70{
71	categoryMenu.superfish('destroy');
72	$('.sf-menu').removeAttr('style');
73
74	mCategoryGrover.on('click', function(){
75		$(this).toggleClass('active').parent().find('ul.menu-content').stop().slideToggle('medium');
76	});
77
78	$('.sf-menu > li > ul').addClass('menu-mobile clearfix').parent().prepend('<span class="menu-mobile-grover"></span>');
79
80	$(".sf-menu .menu-mobile-grover").on('click touchstart', function(){
81		var catSubUl = $(this).next().next('.menu-mobile');
82		if (catSubUl.is(':hidden'))
83		{
84			catSubUl.slideDown();
85			$(this).addClass('active');
86		}
87		else
88		{
89			catSubUl.slideUp();
90			$(this).removeClass('active');
91		}
92		return false;
93	});
94
95	if ('ontouchstart' in document.documentElement)
96	{
97		$('#block_top_menu > ul:first > li > a').on('click', function(e){
98			if ($(this).parent('li').find('ul').length)
99				e.preventDefault();
100		});
101	}
102}
103
104// change the menu display at different resolutions
105function menuChange(status)
106{
107	status == 'enable'? mobileInit(): desktopInit();
108}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.