1$(function() { 2 $('#main-menu_1').smartmenus({ 3 isPopup: false, // is this a popup menu (can be shown via the popupShow/popupHide methods) or a permanent menu bar 4 mainMenuSubOffsetX: 1, // pixels offset from default position 5 mainMenuSubOffsetY: 0, // pixels offset from default position 6 subMenusSubOffsetX: 0, // pixels offset from default position 7 subMenusSubOffsetY: -1, // pixels offset from default position 8 subMenusMinWidth: '200px', // min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored 9 subMenusMaxWidth: '300px', // max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored 10 subIndicators: true, // create sub menu indicators - creates a SPAN and inserts it in the A 11 subIndicatorsPos: 'prepend', // position of the SPAN relative to the menu item content ('prepend', 'append') 12 subIndicatorsText: '+', // [optionally] add text in the SPAN (e.g. '+') (you may want to check the CSS for the sub indicators too) 13 scrollStep: 30, // pixels step when scrolling long sub menus that do not fit in the viewport height 14 scrollInterval: 30, // interval between each scrolling step 15 scrollAccelerate: true, // accelerate scrolling or use a fixed step 16 showTimeout: 250, // timeout before showing the sub menus 17 hideTimeout: 500, // timeout before hiding the sub menus 18 showDuration: 0, // duration for show animation - set to 0 for no animation - matters only if showFunction:null 19 showFunction: null, // custom function to use when showing a sub menu (the default is the jQuery 'show') 20 // don't forget to call complete() at the end of whatever you do 21 // e.g.: function($ul, complete) { $ul.fadeIn(250, complete); } 22 hideDuration: 0, // duration for hide animation - set to 0 for no animation - matters only if hideFunction:null 23 // you can add easing for next functions like this ~~~(1200, 'easeOutBounce', complete)~~~ 24 hideFunction: 0, // custom function to use when hiding a sub menu (the default is the jQuery 'hide') // --> function($ul, complete) { $ul.fadeOut(200, complete); } 25 // don't forget to call complete() at the end of whatever you do 26 // e.g.: function($ul, complete) { $ul.fadeOut(250, complete); } 27 collapsibleShowDuration:0, // duration for show animation for collapsible sub menus - matters only if collapsibleShowFunction:null 28 collapsibleShowFunction:function($ul, complete) { $ul.slideDown(400, complete); }, // custom function to use when showing a collapsible sub menu 29 // (i.e. when mobile styles are used to make the sub menus collapsible) 30 collapsibleHideDuration:0, // duration for hide animation for collapsible sub menus - matters only if collapsibleHideFunction:null 31 collapsibleHideFunction:function($ul, complete) { $ul.slideUp(400, complete); }, // custom function to use when hiding a collapsible sub menu 32 // (i.e. when mobile styles are used to make the sub menus collapsible) 33 showOnClick: false, // show the first-level sub menus onclick instead of onmouseover (matters only for mouse input) 34 hideOnClick: true, // hide the sub menus on click/tap anywhere on the page 35 keepInViewport: true, // reposition the sub menus if needed to make sure they always appear inside the viewport 36 keepHighlighted: true, // keep all ancestor items of the current sub menu highlighted (adds the 'highlighted' class to the A's) 37 markCurrentItem: true, // automatically add the 'current' class to the A element of the item linking to the current URL 38 markCurrentTree: true, // add the 'CURRENT' class also to the A elements of all ancestor items of the current item 39 rightToLeftSubMenus: true, // right to left display of the sub menus (check the CSS for the sub indicators' position) 40 bottomToTopSubMenus: false, // bottom to top display of the sub menus 41 overlapControlsInIE: true // make sure sub menus appear on top of special OS controls in IE (i.e. SELECT, OBJECT, EMBED, etc.) 42 }); 43}); 44 45 46$(document).ready(function() { 47//---> Add Option for also close opened sub menus with (-)button in small screens (+)option already exists 48 window_width = viewport().width; // the correct window sizes with scroller (this fits css @media screen and ..sizes ) 49 var $mainMenu_1 = $('#main-menu_1').on('click', 'span.sub-arrow', function(e) { 50 // toggle the sub menu on sub arrow click in collapsible mode 51 var obj_1 = $mainMenu_1.data('smartmenus'); 52 if (obj_1.isCollapsible()) { 53 var $item_1 = $(this).parent(), 54 $sub_1 = $item_1.parent().dataSM('sub'), 55 subIsVisible = $sub_1.dataSM('shown-before') && $sub_1.is(':visible'); 56 $sub_1.dataSM('arrowClicked', true); 57 obj_1.itemActivate($item_1); 58 if (subIsVisible) { 59 obj_1.menuHide($sub_1); 60 } 61 e.stopPropagation(); 62 e.preventDefault(); 63 } 64 }).bind({ 65 // don't show the sub menu in collapsible mode unless the sub arrow is clicked 66 'beforeshow.smapi': function(e, menu) { 67 var obj_1 = $mainMenu_1.data('smartmenus'); 68 if (obj_1.isCollapsible()) { 69 var $menu = $(menu); 70 if (!$menu.dataSM('arrowClicked')) { 71 return false; 72 } 73 $menu.removeDataSM('arrowClicked'); 74 } 75 }, 76 'show.smapi': function(e, menu) { 77 $(menu).dataSM('parent-a').children('span.sub-arrow').text('-'); 78 //if (window_width < 991 ) { 79 //setTimeout(function(){ 80 equalHeight($(menu).dataSM('parent-a').parent('li').find('.mega-item')); 81 //}, 1000); 82 //} 83 }, 84 'hide.smapi': function(e, menu) { 85 $(menu).dataSM('parent-a').children('span.sub-arrow').text('+'); 86 } 87 }); 88 89 90 //---> Remove position-relative from main category that have sub mega-menu 91 $('ul.mega-menu').each(function() { 92 $(this).parent('li').css('position','static'); 93 }); 94 95}); 96 97 98 99$(window).load(function() { 100 //---> Add rtl class because fuckin' bug 101 if ($('html').attr('lang') == 'he' || $('html').attr('lang') == 'ar' || $('html').attr('lang') == 'am') { 102 $('ul.sm').addClass('sm-rtl'); 103 } 104 105 //---> Equal Height of mega menu sub boxes 106 window_width = viewport().width; // the correct window sizes with scroller (this fits css @media screen and ..sizes ) 107 //console.log(window_width); 108 if (window_width > 990) { //~~~~~~~~~~~~~~~~~~~~~~> 991 ++++++ 109 $('#main-menu_1 > li').each(function() { 110 equalHeight($(this).find('.mega-item')); 111 }); 112 } 113}); 114 115 116 117$(window).resize(function() { 118 window_width = viewport().width; // the correct window sizes with scroller (this fits css @media screen and ..sizes ) 119 //console.log(window_width); 120 var $menu_1 = $('#main-menu_1'); 121 if (window_width > 990) { //~~~~~~~~~~~~~~~~~~~~~~> 991 ++++++ 122 $menu_1.css('display','block'); 123 $('#menu-button').removeClass('collapsed'); 124 } else { 125 if ($menu_1.css('display') != 'none' && !$('#menu-button').hasClass('collapsed')) { 126 $menu_1.css('display','none'); 127 } 128 } 129 130 //---> Equal Height of mega menu sub boxes 131 waitForFinalEvent(function(){ 132 $('#main-menu_1 ul').each(function() { 133 var $this = $(this); 134 if ($this.css('display') == 'block') { 135 equalHeight($this.find('.mega-item')); 136 } 137 }); 138 }, 400, "scroll_vertical"); 139}); 140 141 142 143//---> Add Hide & Show button for (vertical) menu in small screens 144/*$(function() { 145 $('#menu-button').click(function() { 146 var $this = $(this), 147 $menu = $('#main-menu'); 148 if (!$this.hasClass('collapsed')) { 149 $menu.addClass('collapsed'); 150 $this.addClass('collapsed'); 151 } else { 152 $menu.removeClass('collapsed'); 153 $this.removeClass('collapsed'); 154 } 155 return false; 156 }).click(); 157});*/ 158 159//---> Add Hide & Show button for (vertical) menu in small screens 160$(function() { 161 $('#menu-button').click(function() { 162 window_width = viewport().width; // the correct window sizes with scroller (this fits css @media screen and ..sizes ) 163 var $this = $(this), 164 $menu_1 = $('#main-menu_1'); 165 if ($menu_1.css('display') != 'none' && !$this.hasClass('collapsed') && window_width < 991) { 166 $this.addClass('collapsed'); 167 $this.attr('aria-expanded','true'); 168 } 169 if (!$this.hasClass('collapsed')) { 170 $this.addClass('collapsed'); 171 $this.attr('aria-expanded','true'); 172 $("html, body").animate({ scrollTop: "0" },"slow"); 173 $('#go-top').hide(); // hide the 'go to top arrow button' so it soesn't disturbe clicking on bar 174 } else { 175 $this.removeClass('collapsed'); 176 $this.attr('aria-expanded','false'); 177 $('#go-top').show(); 178 } 179 $menu_1.slideToggle( "slow" ); 180 return false; 181 });
182}); 183 184 185
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.