PageSourceSearch

https://apotecaverde.com/assets/blocktopmenu.js

js apotecaverde.com collected 2026-10-05 18:05:49 UTC 4,586 bytes, 144 lines download raw bytes

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

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.