Unminifying the script helped a lot to pin point the adjustments needed ( https://unminify.com/ ) but I just removed these two snippets of code:
Code:
function f(){0<=$(window).innerWidth()?0==$("#js-mobile-navigation ul").length&&(g.show(),$(b).append(h),$("#js-mobile-navigation ul li span").each(function(){if("0"!=$(this).next().length){$(this).addClass("parent");var a=$(this).children("a").text();$(this).parent("li").append('<span data-name="'+a+'" data-rt-icon="" class="next"></span>')}})):0==$("#js-navigation-bar ul").length&&(g.hide(),$("#js-mobile-navigation").find($(".clone").remove()),$("#js-navigation-bar").prepend(h.removeClass("hide")), $(".next").remove())}
Code:
$(window).on("load resize",function(){f()});
I had to tweak the code a little bit in order to replace the JavaScript code that appends the next arrow and allows the user to see the next level categories.
Here is that code:
Code:
<ul id="js-navigation-set" class="&mvte:readytheme:layout;"> <mvt:foreach iterator="navigationitem" array="readytheme:navigationitems"> <mvt:if expr="NOT ISNULL l.settings:navigationitem:items"> <li class="level-1"> <span class="parent">&mvt:navigationitem:link;</span> <ul> <mvt:foreach iterator="navigationitem_level2" array="navigationitem:items"> <mvt:if expr="NOT ISNULL l.settings:navigationitem_level2:items"> <li class="level-2"> <span class="parent">&mvt:navigationitem_level2:link;</span> <ul> <mvt:foreach iterator="navigationitem_level3" array="navigationitem_level2:items"> <li class="level-3"><span>&mvt:navigationitem_level3:link;</span></li> </mvt:foreach> </ul> <span data-name="&mvt:navigationitem_level2:name;" data-rt-icon="" class="next"></span> </li> <mvt:else> <li class="level-2"> <span>&mvt:navigationitem_level2:link;</span> </li> </mvt:if> </mvt:foreach> </ul> <span data-name="&mvt:navigationitem:name;" data-rt-icon="" class="next"></span> </li> <mvt:else> <li class="level-1"> <span>&mvt:navigationitem:link;</span> </li> </mvt:if> </mvt:foreach> </ul>
Everything works just as before but now the navigation set lives within the mobile navigation div.
I'll be changing this on our regular site later today.
Leave a comment: