1/** 2 * CT Mobile Menu 3 * 4 * @package WP Pro Real Estate 7 5 * @subpackage JavaScript 6 */ 7 8jQuery(function ($) { 9 $(document).ready(function () { 10 11 $(".mobile-nav ul").removeClass("cbp-tm-menu"); 12 $(".mobile-nav ul").addClass("cbp-spmenu"); 13 14 $( 15 '<div id="showLeftPush" class="show-hide"><i id="showLeftPushIcon" class="fa fa-navicon"></i></div>', 16 {} 17 ).appendTo("#masthead"); 18 19 var menuLeft = document.getElementById("cbp-spmenu"), 20 showLeftPush = document.getElementById("showLeftPush"), 21 showLeftPushIcon = document.getElementById("showLeftPushIcon"), 22 headerWrap = document.getElementById("header-wrap"), 23 body = document.body; 24 25 if ( ! showLeftPush ) { 26 return; 27 } 28 29 (container = document.getElementById("wrapper")), 30 (showLeftPush.onclick = function () { 31 $("body").bind("touchmove", function (e) { 32 e.preventDefault(); 33 }); 34 classie.toggle(this, "active"); 35 classie.toggle(body, "cbp-spmenu-push-toleft"); 36 classie.toggle(body, "stop-scrolling"); 37 classie.toggle(menuLeft, "cbp-spmenu-open"); 38 classie.toggle(showLeftPushIcon, "fa-close"); 39 40 classie.toggle(headerWrap, "to-left"); 41 }); 42 43 if (!$("body").hasClass("stop-scrolling")) { 44 $("body").unbind("touchmove"); 45 } 46 }); 47}); 48 49/** 50 * Toggle Support 51 * jshint: es6 52 */ 53jQuery(document).ready(function ($) { 54 55 "use strict"; 56 57 let $mobile_menu = $("#cbp-spmenu ul.menu"); 58 let $parent_menu_items = $mobile_menu.find("li.menu-item-has-children"); 59 // iterate on each child to appeand the toggle icon. 60 $.each($parent_menu_items, function () { 61 $("> a", $(this)).append("<span class='submenu-toggle'><i class='fas fa-chevron-down'></i></span>"); 62 63 }); 64 65 $("#cbp-spmenu li.current-menu-item").parentsUntil('ul.menu').addClass('open'); 66 $("#cbp-spmenu li.current-menu-item").parentsUntil('ul.menu').css('display', 'block'); 67 68 // Toggle event. 69 $("span.submenu-toggle").click(function (e) { 70 e.preventDefault(); 71 let $parent_list = $(this).parent().parent(); 72 $parent_list.toggleClass('open'); 73 $parent_list.find(" > ul.sub-menu").slideToggle('fast'); 74 }); 75}); 76
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.