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