https://yogabetter.com/wp-content/plugins/netgo-expandablecollapsible-menu/include/script.js?ver=1.0
1jQuery(function($) { 2 3 var $netgo_navigations = $("div.netgo_navigation"); 4 var options = window.netgo_navigation_options; 5 6 // hide childs on load 7 $netgo_navigations.find("ul ul").hide(); 8 $netgo_navigations.find(".sub-menu").hide(); 9 10 // open up onstart 11 //$netgo_navigations.find("li.current_page_ancestor,li.current_page_parent,li.current_page_item").find("ul:first").show(); 12 13 // Click on a = possibly expand, or possibly go to link 14 $netgo_navigations.find("ul a").live("click", function(e, isFromLI) { 15 16 e.stopPropagation(); 17 18 $this = $(this); 19 var do_expand = true; 20 21 // get the options for this instance 22 var widget_wrapper = $this.closest("div.netgo_navigation"); 23 var widget_options = options[widget_wrapper.attr("id").replace("-", "")]; 24 25 // Grab the ul that we will expand/collapse 26 var next_ul = $this.next("ul"); 27 28 // Determine if this is the parent link of a ul or not 29 if (!next_ul.length) { 30 // Not a parent, does not have childs. Just go to the link. 31 return true; 32 } 33 34 // click on link, don't do anything unless "clickable_parent" is true, then we expand! 35 // or if the click comes from an LI-element, then do not go to link, just expand 36 if (widget_options.clickable_parent || isFromLI) { 37 // clickable parent, so expand and don't go to link 38 e.preventDefault(); 39 } else { 40 // not clickable parent, don't expand, go to link 41 // COMMENTED OUT AND PREVENT DEFAULT ADDED BY YVAN ON 7/29/2020 42 //do_expand = false; 43 e.preventDefault(); 44 45 } 46 47 if (do_expand) { 48 49 if ($this.next("ul").length) { 50 $this.next("ul:first").slideToggle("fast", function() { 51 if ( $this.find("ul:first").is(":visible") ) { 52 $this.removeClass("netgo-navigation-deselected"); 53 $this.addClass("netgo-navigation-selected"); 54 } else { 55 $this.removeClass("netgo-navigation-selected"); 56 $this.addClass("netgo-navigation-deselected"); 57 } 58 }); 59 60 } 61 62 } 63 64 }); 65 66 // Click on li = expand, but don't go to link 67 $netgo_navigations.find("ul li").live("click", function(e) { 68 69 // click the first a below this one, because that's where the action is 70 e.stopPropagation(); 71 var $this = $(this); 72
73 // Trigger click event on the link. 74 // Also pass extraParameter "true" that tells the click event to just expand and not go to the link 75 $this.find("a:first").trigger("click", [true]); 76 77 return; 78 79 }); 80});
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.