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// init Super Fish Menu for 767px+ resolution 31 32function desktopInit() { 33 mCategoryGrover.off(); 34 mCategoryGrover.removeClass('active'); 35 $('.sf-menu > li > ul').removeClass('menu-mobile').parent().find('.menu-mobile-grover').remove(); 36 $('.sf-menu').removeAttr('style'); 37 categoryMenu.superfish('init'); 38 $('.sf-menu > li > ul').addClass('submenu-container clearfix'); //add class for width define 39 i = 0; 40 $('.sf-menu > li > ul > li:not(#category-thumbnail)').each(function(){ //add classes for clearing 41 i++; 42 if(i%2 == 1) 43 $(this).addClass('first-in-line-xs'); 44 else if (i%5 == 1) 45 $(this).addClass('first-in-line-lg'); 46 }); 47} 48 49function mobileInit() { 50 categoryMenu.superfish('destroy'); 51 $('.sf-menu').removeAttr('style'); 52 mCategoryGrover.on('click', function(){ 53 $(this).toggleClass('active').parent().find('ul.menu-content').stop().slideToggle('medium'); 54 }), 55 $('.sf-menu > li > ul').addClass('menu-mobile clearfix').parent().prepend('<span class="menu-mobile-grover"></span>'); 56 $(".sf-menu .menu-mobile-grover").on('click touchstart', function() { 57 var catSubUl = $(this).next().next('.menu-mobile'); 58 if(catSubUl.is(':hidden')) { 59 catSubUl.slideDown(), 60 $(this).addClass('active') 61 } 62 else { 63 catSubUl.slideUp(), 64 $(this).removeClass('active'); 65 } 66 return false 67 }) 68} 69 70// change the menu display at different resolutions 71function menuChange(status) 72{ 73 status == 'enable'?mobileInit():desktopInit() 74} 75 76// check resolution 77function responsiveMenu() 78{ 79 if ($(document).width() <= 767 && responsiveflagMenu == false) 80 { 81 menuChange('enable'); 82 responsiveflagMenu = true; 83 84 } 85 else if ($(document).width() >= 768) 86 { 87 menuChange('disable'); 88 responsiveflagMenu = false;
89 } 90} 91 92$(document).ready(responsiveMenu); 93$(window).resize(responsiveMenu);
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.