Для внесения изменений пройдите в раздел Сайт - Редактор шаблонов - main.js найдите код:
function mainnav(){ var overMenuExist = $('.overflowMenu li').length; if(overMenuExist){ $('.overflowMenu li').removeClass('mainnav__replaced'); $('.header-sections .mainnav__more').remove(); $('.overflowMenu li').each(function(){ $('.header-sections .header-sectionsList ').append($(this)); }) } menuWidth = $('.header-sections').width(); menuCount = $('.header-sections .header-sectionsList li').length + 1; var nextCheck = 0; var CurrentWidthCounter = 0; for(var i=1; i < menuCount; i++){ currentWidth = parseInt(Math.ceil($('.header-sections .header-sectionsList li:nth-child('+i+')').width())) + 46; nextCheck += currentWidth; if(nextCheck > menuWidth){ var a = i; for(a;a < menuCount;a++){ $('.header-sections .header-sectionsList li:nth-child('+ a +')').addClass('mainnav__replaced'); } $('.header-sections .mainnav__replaced').each(function(){ $('.overflowMenu').append($(this)); }); $('.header-sections .header-sectionsList ').append('<li class="header-sectionsItem mainnav__more"><a class="header-catalogLink">Еще...</a></li>'); menuMorePosition = parseInt($('.mainnav__more').position().left); $('.header-sections .mainnav__more').on('click',function(){ $('.overflowMenu').toggleClass('active') $('.header-sections .header-sectionsList ').toggleClass('active') }); $(function($){ $(document).mouseup(function (e){ var div = $(".overflowMenu.active"); var btn = $(".header-sections .mainnav__more"); if (!div.is(e.target) && div.has(e.target).length === 0 && !btn.is(e.target)) { div.removeClass('active'); $('.header-sections .header-sectionsList ').removeClass('active'); } }); }); return false; } } }
Замените на:
function mainnav(){ var overMenuExist = $('.overflowMenu li').length; if(overMenuExist){ $('.overflowMenu li').removeClass('mainnav__replaced'); $('.header-sections .mainnav__more').remove(); $('.overflowMenu li').each(function(){ $('.header-sections .header-sectionsList ').append($(this)); }) } menuWidth = $('.header-sections').width(); menuCount = $('.header-sections .header-sectionsList li.header-sectionsItem').length + 1; var nextCheck = 0; var CurrentWidthCounter = 0; for(var i=1; i < menuCount; i++){ currentWidth = parseInt(Math.ceil($('.header-sections .header-sectionsList li.header-sectionsItem:nth-child('+i+')').width())) + 46; nextCheck += currentWidth; if(nextCheck > menuWidth){ var a = i; for(a;a < menuCount;a++){ $('.header-sections .header-sectionsList li.header-sectionsItem:nth-child('+ a +')').addClass('mainnav__replaced'); } $('.header-sections .mainnav__replaced').each(function(){ $('.overflowMenu').append($(this)); }); $('.header-sections .header-sectionsList ').append('<li class="header-sectionsItem mainnav__more"><a class="header-catalogLink">Еще...</a></li>'); menuMorePosition = parseInt($('.mainnav__more').position().left); $('.header-sections .mainnav__more').on('click',function(){ $('.overflowMenu').toggleClass('active') $('.header-sections .header-sectionsList ').toggleClass('active') }); $(function($){ $(document).mouseup(function (e){ var div = $(".overflowMenu.active"); var btn = $(".header-sections .mainnav__more"); if (!div.is(e.target) && div.has(e.target).length === 0 && !btn.is(e.target)) { div.removeClass('active'); $('.header-sections .header-sectionsList ').removeClass('active'); } }); }); return false; } } }