1/******************************************************************************/ 2/******************************************************************************/ 3 4;(function($,doc,win) 5{ 6 "use strict"; 7 8 var Header=function(object,themeOption) 9 { 10 /**********************************************************************/ 11 12 var $self=this; 13 var $themeOption=themeOption; 14 15 var $header; 16 17 var $headerTop; 18 var $headerMiddle; 19 var $headerBottom; 20 21 var $menuDefault; 22 var $menuResponsive; 23 var $menuResponsiveList; 24 25 /**********************************************************************/ 26 27 this.create=function() 28 { 29 $header=$('.theme-page-header'); 30 31 $headerTop=$header.find('.theme-page-header-top'); 32 $headerMiddle=$header.find('.theme-page-header-middle'); 33 $headerBottom=$header.find('.theme-page-header-bottom'); 34 35 $menuDefault=$header.find('.theme-menu.theme-menu-default'); 36 $menuResponsive=$header.find('.theme-menu.theme-menu-responsive'); 37 38 $menuResponsiveList=$menuResponsive.children('ul.theme-menu-responsive-list'); 39 40 $self.build(); 41 }; 42 43 /**********************************************************************/ 44 45 this.build=function() 46 { 47 $self.createMenuDefault(); 48 49 /***/ 50 51 $self.createMenuResponsive(); 52 53 /***/ 54 55 $(window).windowDimensionListener({change:function(width,height) 56 { 57 if(width || height) 58 { 59 $self.createHeaderResponsive(); 60 } 61 }}); 62 63 /***/ 64 65 $header.css({display:'block'}); 66 }; 67 68 /**********************************************************************/ 69 70 this.createMenuDefault=function() 71 { 72 if($menuDefault.children('ul').length===1) 73 { 74 $menuDefault.children('ul').superfish( 75 { 76 delay:0, 77 cssArrows:false, 78 speedOut:0, 79 animation:{opacity:'show'}, 80 onInit:function () 81 { 82 83 } 84 }); 85 //.supposition(); 86 }; 87 88 /***/ 89 90 $menuDefault.find('li.menu-item-has-children>a>span:first-child+span+span').addClass('theme-icon-meta-arrow-vertical-2'); 91 }; 92 93 /**********************************************************************/ 94 95 this.createHeaderResponsive=function() 96 { 97 var width=$header.parent().actual('width'); 98 99 if(width<1224) 100 { 101 $('body').addClass('theme-menu-mode-responsive'); 102 } 103 else 104 { 105 $('body').removeClass('theme-menu-mode-responsive'); 106 $menuResponsiveList.css('top','-999em'); 107 } 108 }; 109 110 /**********************************************************************/ 111 112 this.createMenuResponsive=function() 113 { 114 if($header.length===1) 115 { 116 /****/ 117 118 $menuResponsiveList.appendTo($('body')); 119 120 /***/ 121 122 var button=$(document.createElement('a')); 123 124 button.addClass('theme-menu-responsive-button'); 125 126 button.on('click',function(e) 127 { 128 e.preventDefault(); 129 $self.openMenuResponsive(); 130 }); 131 132 $menuResponsive.append(button); 133 134 /***/ 135 136 $menuResponsiveList.find('li.menu-item-has-children>a>span:first-child+span+span').addClass('theme-icon-meta-arrow-vertical-3'); 137 138 $menuResponsiveList.find('.theme-icon-meta-arrow-vertical-3').on('click',function(e) 139 { 140 e.preventDefault(); 141 $(this).parent('a').next('ul').slideToggle(200); 142 }); 143 144 /****/ 145 146 var html='<li><a href="#" class="theme-icon-meta-arrow-vertical-3"></a></li>'; 147 148 $menuResponsiveList.prepend(html); 149 150 $menuResponsiveList.find('>li:first-child>a').on('click',function(e) 151 { 152 e.preventDefault(); 153 $self.closeMenuResponsive(); 154 }); 155 156 /****/ 157 } 158 }; 159 160 /**********************************************************************/ 161 162 this.openMenuResponsive=function() 163 { 164 $menuResponsiveList.css({'top':-1*$menuResponsiveList.actual('outerHeight')}); 165 166 var top=0; 167 168 if($('#wpadminbar').length===1) 169 top+=parseInt($('#wpadminbar').actual('height'),10); 170 171 $menuResponsiveList.animate({top:top},{duration:300,easing:'swing'},function() 172 { 173 174 }); 175 }; 176 177 /**********************************************************************/ 178 179 this.closeMenuResponsive=function() 180 { 181 var height=-1*$menuResponsiveList.actual('outerHeight'); 182 183 $menuResponsiveList.animate({top:height},{duration:300,easing:'swing'},function() 184 {
185 186 }); 187 }; 188 189 /**********************************************************************/ 190 }; 191 192 /**************************************************************************/ 193 194 $.fn.header=function(themeOption) 195 { 196 var header=new Header(this,themeOption); 197 header.create(); 198 }; 199 200 /**************************************************************************/ 201 202})(jQuery,document,window); 203 204/******************************************************************************/ 205/******************************************************************************/
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.