1/* 2* Template Name: Unify - Responsive Bootstrap Template 3* Author: @htmlstream 4* Website: http://htmlstream.com 5*/ 6 7var App = function () { 8 // We extend jQuery by method hasAttr 9 $.fn.hasAttr = function(name) { 10 return this.attr(name) !== undefined; 11 }; 12 13 // Fixed Header 14 function handleHeader() { 15 if (jQuery(window).scrollTop() > 100) { 16 jQuery('.header-fixed .header-sticky').addClass('header-fixed-shrink'); 17 } 18 jQuery(window).scroll(function() { 19 if (jQuery(window).scrollTop() > 100) { 20 jQuery('.header-fixed .header-sticky').addClass('header-fixed-shrink'); 21 } else { 22 jQuery('.header-fixed .header-sticky').removeClass('header-fixed-shrink'); 23 } 24 }); 25 } 26 27 // Header Mega Menu 28 function handleMegaMenu() { 29 jQuery(document).on('click', '.mega-menu .dropdown-menu', function(e) { 30 e.stopPropagation(); 31 }) 32 } 33 34 // Search Box (Header) 35 function handleSearch() { 36 jQuery('.search').on("click", function () { 37 if(jQuery('.search-btn').hasClass('fa-search')){ 38 jQuery('.search-open').fadeIn(500); 39 jQuery('.search-btn').removeClass('fa-search'); 40 jQuery('.search-btn').addClass('fa-times'); 41 } else { 42 jQuery('.search-open').fadeOut(500); 43 jQuery('.search-btn').addClass('fa-search'); 44 jQuery('.search-btn').removeClass('fa-times'); 45 } 46 }); 47 } 48 49 // Search Box v1 (Header v5) 50 function handleSearchV1() { 51 jQuery('.header-v5 .search-button').click(function () { 52 jQuery('.header-v5 .search-open').slideDown(); 53 }); 54 55 jQuery('.header-v5 .search-close').click(function () { 56 jQuery('.header-v5 .search-open').slideUp(); 57 }); 58 59 jQuery(window).scroll(function(){ 60 if(jQuery(this).scrollTop() > 1) jQuery('.header-v5 .search-open').fadeOut('fast'); 61 }); 62 } 63 64 // Search Box v2 (Header v8) 65 function handleSearchV2() { 66 $(".blog-topbar .search-btn").on("click", function() { 67 if (jQuery(".topbar-search-block").hasClass("topbar-search-visible")) { 68 jQuery(".topbar-search-block").slideUp(); 69 jQuery(".topbar-search-block").removeClass("topbar-search-visible"); 70 } else { 71 jQuery(".topbar-search-block").slideDown(); 72 jQuery(".topbar-search-block").addClass("topbar-search-visible"); 73 } 74 }); 75 $(".blog-topbar .search-close").on("click", function() { 76 jQuery(".topbar-search-block").slideUp(); 77 jQuery(".topbar-search-block").removeClass("topbar-search-visible"); 78 }); 79 jQuery(window).scroll(function() { 80 jQuery(".topbar-search-block").slideUp(); 81 jQuery(".topbar-search-block").removeClass("topbar-search-visible"); 82 }); 83 } 84 85 // TopBar (Header v8) 86 function handleTopBar() { 87 $(".topbar-toggler").on("click", function() { 88 if (jQuery(".topbar-toggler").hasClass("topbar-list-visible")) { 89 jQuery(".topbar-menu").slideUp(); 90 jQuery(this).removeClass("topbar-list-visible"); 91 } else { 92 jQuery(".topbar-menu").slideDown(); 93 jQuery(this).addClass("topbar-list-visible"); 94 } 95 }); 96 } 97 98 // TopBar SubMenu (Header v8) 99 function handleTopBarSubMenu() { 100 $(".topbar-list > li").on("click", function(e) { 101 if (jQuery(this).children("ul").hasClass("topbar-dropdown")) { 102 if (jQuery(this).children("ul").hasClass("topbar-dropdown-visible")) { 103 jQuery(this).children(".topbar-dropdown").slideUp(); 104 jQuery(this).children(".topbar-dropdown").removeClass("topbar-dropdown-visible"); 105 } else { 106 jQuery(this).children(".topbar-dropdown").slideDown(); 107 jQuery(this).children(".topbar-dropdown").addClass("topbar-dropdown-visible"); 108 } 109 } 110 //e.preventDefault(); 111 }); 112 } 113 114 // Sidebar Navigation Toggle 115 function handleToggle() { 116 jQuery('.list-toggle').on('click', function() { 117 jQuery(this).toggleClass('active'); 118 }); 119 } 120 121 // Equal Height Columns 122 function handleEqualHeightColumns() { 123 var EqualHeightColumns = function () { 124 $(".equal-height-columns").each(function() { 125 heights = []; 126 $(".equal-height-column .paragraphe", this).each(function() { 127 $(this).removeAttr("style"); 128 heights.push($(this).height()); // write column's heights to the array 129 }); 130 $(".equal-height-column .paragraphe", this).height(Math.max.apply(Math, heights)); //find and set max 131 }); 132 } 133 134 EqualHeightColumns(); 135 $(window).resize(function() { 136 EqualHeightColumns(); 137 }); 138 $(window).load(function() { 139 EqualHeightColumns(); 140 }); 141 } 142 143 // Equal Height Image-Columns 144 function handleEqualHeightColumns__Images() { 145 var EqualHeightColumns__Images = function () { 146 $('.equal-height-columns-v2').each(function() { 147 var heights = []; 148 $('.equal-height-column-v2', this).each(function() { 149 $(this).removeAttr('style'); 150 heights.push($(this).height()); // Write column's heights to the array 151 }); 152 $('.equal-height-column-v2', this).height(Math.max.apply(Math, heights)); // Find and set max 153 154 $('.equal-height-column-v2', this).each(function() { 155 if ($(this).hasAttr('data-image-src')) { 156 $(this).css('background', 'url('+$(this).attr('data-image-src')+') no-repeat scroll 50% 0 / cover'); 157 } 158 }); 159 }); 160 } 161 $('.equal-height-columns-v2').ready(function() { 162 EqualHeightColumns__Images(); 163 }); 164 $(window).resize(function() { 165 EqualHeightColumns__Images(); 166 }); 167 } 168 169 // Full Screen 170 var handleFullscreen = function() { 171 var WindowHeight = $(window).height(); 172 var HeaderHeight = 0; 173 174 if ($(document.body).hasClass("promo-padding-top")) { 175 HeaderHeight = $(".header").height(); 176 } else { 177 HeaderHeight = 0; 178 } 179 180 $(".fullheight").css("height", WindowHeight - HeaderHeight); 181 182 $(window).resize(function() { 183 var WindowHeight = $(window).height(); 184 $(".fullheight").css("height", WindowHeight - HeaderHeight); 185 }); 186 } 187 188 // Align Middle 189 var handleValignMiddle = function() { 190 $(".valign__middle").each(function() { 191 $(this).css("padding-top", $(this).parent().height() / 2 - $(this).height() / 2); 192 }); 193 $(window).resize(function() { 194 $(".valign__middle").each(function() { 195 $(this).css("padding-top", $(this).parent().height() / 2 - $(this).height() / 2); 196 }); 197 }); 198 } 199 200 // Hover Selector 201 function handleHoverSelector() { 202 // $('.hoverSelector').on('hover', function(e) { 203 // $('.hoverSelectorBlock', this).toggleClass('show'); 204 // e.stopPropagation(); 205 // }); 206 $('.hoverSelector').on('click', function(e) { 207 if (jQuery(this).children('ul').hasClass('languages')) { 208 if (jQuery(this).children('ul').hasClass('languages-visible')) {
209 jQuery(this).children('.languages').slideUp(); 210 jQuery(this).children('.languages').removeClass('languages-visible'); 211 } else { 212 jQuery(this).children('.languages').slideDown(); 213 jQuery(this).children('.languages').addClass('languages-visible'); 214 } 215 } 216 //e.preventDefault(); 217 }); 218 } 219 220 // Bootstrap Tooltips and Popovers 221 function handleBootstrap() { 222 /* Bootstrap Carousel */ 223 jQuery('.carousel').carousel({ 224 interval: 15000, 225 pause: 'hover' 226 }); 227 228 /* Tooltips */ 229 jQuery('.tooltips').tooltip(); 230 jQuery('.tooltips-show').tooltip('show'); 231 jQuery('.tooltips-hide').tooltip('hide'); 232 jQuery('.tooltips-toggle').tooltip('toggle'); 233 jQuery('.tooltips-destroy').tooltip('destroy'); 234 235 /* Popovers */ 236 jQuery('.popovers').popover(); 237 jQuery('.popovers-show').popover('show'); 238 jQuery('.popovers-hide').popover('hide'); 239 jQuery('.popovers-toggle').popover('toggle'); 240 jQuery('.popovers-destroy').popover('destroy'); 241 } 242 243 return { 244 init: function () { 245 handleBootstrap(); 246 handleSearch(); 247 handleSearchV1(); 248 handleSearchV2(); 249 handleTopBar(); 250 handleTopBarSubMenu(); 251 handleToggle(); 252 handleHeader(); 253 handleMegaMenu(); 254 handleHoverSelector(); 255 handleFullscreen(); 256 handleValignMiddle(); 257 handleEqualHeightColumns(); 258 handleEqualHeightColumns__Images(); 259 }, 260 261 // Counters 262 initCounter: function () { 263 jQuery('.counter').counterUp({ 264 delay: 10, 265 time: 1000 266 }); 267 }, 268 269 // Parallax Backgrounds 270 initParallaxBg: function () { 271 jQuery(window).load(function() { 272 jQuery('.parallaxBg').parallax("50%", 0.2); 273 jQuery('.parallaxBg1').parallax("50%", 0.4); 274 }); 275 }, 276 277 // Scroll Bar 278 initScrollBar: function () { 279 jQuery('.mCustomScrollbar').mCustomScrollbar({ 280 theme:"minimal", 281 scrollInertia: 200, 282 scrollEasing: "linear" 283 }); 284 }, 285 286 // Sidebar Menu Dropdown 287 initSidebarMenuDropdown: function() { 288 function SidebarMenuDropdown() { 289 jQuery('.header-v7 .dropdown-toggle').on('click', function() { 290 jQuery('.header-v7 .dropdown-menu').stop(true, false).slideUp(); 291 jQuery('.header-v7 .dropdown').removeClass('open'); 292 293 if (jQuery(this).siblings('.dropdown-menu').is(":hidden") == true) { 294 jQuery(this).siblings('.dropdown-menu').stop(true, false).slideDown(); 295 jQuery(this).parents('.dropdown').addClass('open'); 296 } 297 }); 298 } 299 SidebarMenuDropdown(); 300 }, 301 302 // Animate Dropdown 303 initAnimateDropdown: function() { 304 function MenuMode() { 305 jQuery('.dropdown').on('show.bs.dropdown', function() { 306 jQuery(this).find('.dropdown-menu').first().stop(true, true).slideDown(); 307 }); 308 jQuery('.dropdown').on('hide.bs.dropdown', function() { 309 jQuery(this).find('.dropdown-menu').first().stop(true, true).slideUp(); 310 }); 311 } 312 313 jQuery(window).resize(function() { 314 if (jQuery(window).width() > 768) { 315 MenuMode(); 316 } 317 }); 318 319 if (jQuery(window).width() > 768) { 320 MenuMode(); 321 } 322 }, 323 }; 324}();
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.