1(function($) { 2 "use strict"; 3 var GaviasTheme = { 4 init: function(){ 5 this.initResponsive(); 6 this.initCarousel(); 7 this.menuMobile(); 8 this.postMasonry(); 9 this.scrollTop(); 10 this.stickyMenu(); 11 this.other(); 12 13 $('.team__progress-bar').each(function(){ 14 var $progressbar = $(this); 15 $progressbar.css('width', $progressbar.data('progress-max')); 16 }) 17 $('.review__progress-bar').each(function(){ 18 var $progressbar = $(this); 19 $progressbar.css('width', $progressbar.data('progress-max')); 20 }) 21 }, 22 23 initResponsive: function(){ 24 var _event = $.event, 25 $special, resizeTimeout; 26 $special = _event.special.debouncedresize = { 27 setup: function () { 28 $(this).on("resize", $special.handler); 29 }, 30 teardown: function () { 31 $(this).off("resize", $special.handler); 32 }, 33 handler: function (event, execAsap) { 34 var context = this, 35 args = arguments, 36 dispatch = function () { 37 event.type = "debouncedresize"; 38 _event.dispatch.apply(context, args); 39 }; 40 if (resizeTimeout) { 41 clearTimeout(resizeTimeout); 42 } 43 execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold); 44 }, 45 threshold: 150 46 }; 47 }, 48 49 initCarousel: function(){ 50 $('.init-carousel-owl-theme').each(function(){ 51 var items = GaviasTheme.carouselOptInit('items', this); 52 var items_lg = GaviasTheme.carouselOptInit('items_lg', this); 53 var items_md = GaviasTheme.carouselOptInit('items_md', this); 54 var items_sm = GaviasTheme.carouselOptInit('items_sm', this); 55 var items_xs = GaviasTheme.carouselOptInit('items_xs', this); 56 var loop = GaviasTheme.carouselOptInit('loop', this); 57 var speed = GaviasTheme.carouselOptInit('speed', this); 58 var auto_play = GaviasTheme.carouselOptInit('auto_play', this); 59 var auto_play_speed = GaviasTheme.carouselOptInit('auto_play_speed', this); 60 var auto_play_timeout = GaviasTheme.carouselOptInit('auto_play_timeout', this); 61 var auto_play_hover = GaviasTheme.carouselOptInit('auto_play_hover', this); 62 var navigation = GaviasTheme.carouselOptInit('navigation', this); 63 var rewind_nav = GaviasTheme.carouselOptInit('rewind_nav', this); 64 var pagination = GaviasTheme.carouselOptInit('pagination', this); 65 var mouse_drag = GaviasTheme.carouselOptInit('mouse_drag', this); 66 var touch_drag = GaviasTheme.carouselOptInit('touch_drag', this); 67 $(this).owlCarousel({ 68 nav: navigation, 69 autoplay: auto_play, 70 autoplayTimeout: auto_play_timeout, 71 autoplaySpeed: auto_play_speed, 72 autoplayHoverPause: auto_play_hover, 73 navText: [ '<span><i class="las la-arrow-left"></i></span>', '<span><i class="las la-arrow-right"></i></span>' ], 74 autoHeight: false, 75 loop: loop, 76 dots: pagination, 77 rewind: rewind_nav, 78 smartSpeed: speed, 79 mouseDrag: mouse_drag, 80 touchDrag: touch_drag, 81 responsive : { 82 0 : { 83 items: 1, 84 nav: false 85 }, 86 580 : { 87 items : items_xs, 88 nav: false 89 }, 90 768 : { 91 items : items_sm, 92 nav: false 93 }, 94 992: { 95 items : items_md 96 }, 97 1200: { 98 items: items_lg 99 }, 100 1400: { 101 items: items 102 } 103 } 104 }); 105 }); 106 }, 107 108 carouselOptInit: function(opt, context){ 109 const opts = { 110 items: 5, 111 items_lg: 4, 112 items_md: 3, 113 items_sm: 2, 114 items_xs: 1, 115 loop: false, 116 speed: 200, 117 auto_play: false, 118 auto_play_speed: false, 119 auto_play_timeout: 1000, 120 auto_play_hover: false, 121 navigation: false, 122 rewind_nav: false, 123 pagination: false, 124 mouse_drag: false, 125 touch_drag: false 126 } 127 return $(context).data(opt) ? $(context).data(opt) : opts[opt]; 128 }, 129 130 menuMobile: function(){ 131 $('.gva-offcanvas-content ul.gva-mobile-menu > li:has(ul)').addClass("has-sub"); 132 $('.gva-offcanvas-content ul.gva-mobile-menu > li:has(ul) > a').after('<span class="caret"></span>'); 133 $( document ).on('click', '.gva-offcanvas-content ul.gva-mobile-menu > li > .caret', function(e){
134 e.preventDefault(); 135 var checkElement = $(this).next(); 136 $('.gva-offcanvas-content ul.gva-mobile-menu > li').removeClass('menu-active'); 137 $(this).closest('li').addClass('menu-active'); 138 139 if((checkElement.is('.submenu-inner')) && (checkElement.is(':visible'))) { 140 $(this).closest('li').removeClass('menu-active'); 141 checkElement.slideUp('normal'); 142 } 143 144 if((checkElement.is('.submenu-inner')) && (!checkElement.is(':visible'))) { 145 $('.gva-offcanvas-content ul.gva-mobile-menu .submenu-inner:visible').slideUp('normal'); 146 checkElement.slideDown('normal'); 147 } 148 149 if (checkElement.is('.submenu-inner')) { 150 return false; 151 } else { 152 return true; 153 } 154 }) 155 156 $( '.canvas-menu.gva-offcanvas > a.dropdown-toggle' ).on( 'click', function(e) { 157 e.preventDefault(); 158 var $style = $(this).data('canvas'); 159 if($('.gva-offcanvas-content' + $style).hasClass('open')){ 160 $('.gva-offcanvas-content' + $style).removeClass('open'); 161 $('#gva-overlay').removeClass('open'); 162 $('#wp-main-content').removeClass('blur'); 163 }else{ 164 $('.gva-offcanvas-content' + $style).addClass('open'); 165 $('#gva-overlay').addClass('open'); 166 $('#wp-main-content').addClass('blur'); 167 } 168 }); 169 170 $( '#gva-overlay' ).on( 'click', function(e) { 171 e.preventDefault(); 172 $(this).removeClass('open'); 173 $('.gva-offcanvas-content').removeClass('open'); 174 $('#wp-main-content').removeClass('blur'); 175 }) 176 177 $( '.top-canvas a.control-close-mm' ).on( 'click', function(e) { 178 e.preventDefault(); 179 $('.gva-offcanvas-content').removeClass('open'); 180 $('#gva-overlay').removeClass('open'); 181 $('#wp-main-content').removeClass('blur'); 182 }); 183 184 }, 185 186 postMasonry: function(){ 187 var $container = $('.post-masonry-style'); 188 $container.imagesLoaded( function(){ 189 $container.masonry({ 190 itemSelector : '.item-masory', 191 gutterWidth: 0, 192 columnWidth: 1, 193 }); 194 }); 195 }, 196 197 scrollTop: function(){ 198 var offset = 300; 199 var duration = 500; 200 201 jQuery(window).scroll(function() { 202 if (jQuery(this).scrollTop() > offset) { 203 jQuery('.return-top').fadeIn(duration); 204 } else { 205 jQuery('.return-top').fadeOut(duration); 206 } 207 }); 208 209 $( document ).on('click', '.return-top', function(event){ 210 event.preventDefault(); 211 jQuery('html, body').animate({scrollTop: 0}, duration); 212 return false; 213 }); 214 }, 215 216 carouselProductThumbnail: function(){ 217 $('ol.flex-control-nav').each(function(){ 218 $(this).owlCarousel({ 219 nav: false, 220 navText: [ '<span><i class="las la-arrow-left"></i></span>', '<span><i class="las la-arrow-right"></i></span>' ], 221 margin: 10, 222 dots: false, 223 loop: false, 224 responsive : { 225 0 : { 226 items: 2, 227 nav: false 228 }, 229 640 : { 230 items : 3, 231 nav: false 232 }, 233 768 : { 234 items : 4, 235 nav: false 236 }, 237 992: { 238 items : 4 239 }, 240 1200: { 241 items: 4 242 }, 243 1400: { 244 items: 4 245 } 246 } 247 }); 248 }); 249 }, 250 251 stickyMenu: function(){ 252 253 if( $('.gv-sticky-menu').length > 0 ){ 254 $( ".gv-sticky-menu" ).wrap( "<div class='gv-sticky-wrapper'></div>" ); 255 256 var headerHeight = $('.gv-sticky-menu').height(); 257 var menu = $('.gv-sticky-wrapper'); 258 259 $(window).on('scroll', function () { 260 if ($(window).scrollTop() > menu.offset().top) { 261 menu.addClass('is-fixed'); 262 $('body').addClass('header-is-fixed'); 263 menu.css('height', headerHeight); 264 } else { 265 menu.removeClass('is-fixed'); 266 menu.css('height', 'auto'); 267 $('body').removeClass('header-is-fixed'); 268 } 269 }); 270 } 271 }, 272 273 other: function(){ 274 $('.popup-video').magnificPopup({ 275 type: 'iframe',
276 fixedContentPos: false 277 }); 278 279 $( document ).on( 'click', '.yith-wcwl-add-button.show a', function() { 280 $(this).addClass('loading'); 281 }); 282 283 $(document).on('click', '.gva-search > a.control-search', function(){ 284 let _btn = $(this); 285 if(_btn.hasClass('search-open')){ 286 _btn.parents('.gva-search').removeClass('open'); 287 _btn.removeClass('search-open'); 288 }else{ 289 _btn.parents('.gva-search').addClass('open'); 290 _btn.addClass('search-open'); 291 setTimeout(function(){ 292 _btn.parent('.main-search').find('.gva-search input.input-search').first().focus(); 293 }, 100); 294 } 295 }); 296 297 $(document).on('click', '.mini-cart-header .mini-cart', function(e){ 298 e.preventDefault(); 299 $(this).parent('.mini-cart-inner').addClass('open'); 300 }); 301 $(document).on('click', '.mini-cart-header .minicart-overlay', function(e){ 302 e.preventDefault(); 303 $(this).parent('.mini-cart-inner').removeClass('open'); 304 }); 305 306 $('.gsc-quick-sidebar .control-qsidebar').on('click', function(e){ 307 e.preventDefault(); 308 $(this).parents('.quick-sidebar-wrapper').addClass('open'); 309 }); 310 $('.gsc-quick-sidebar .close-canvas').on('click', function(e){ 311 e.preventDefault(); 312 $(this).parents('.quick-sidebar-wrapper').removeClass('open'); 313 }); 314 315 316 $('.mini-cart-header .dropdown .minicart-content, .quick-sidebar-content').perfectScrollbar(); 317 318 $('.scroll-link[href*="#"]:not([href="#"])').click(function() { 319 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 320 var target = $(this.hash); 321 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 322 if (target.length) { 323 $('html, body').animate({ 324 scrollTop: target.offset().top - 100 325 }, 1500); 326 return false; 327 } 328 } 329 }); 330 331 $('.gva-portfolio-grid .portfolio-filter').each(function(){ 332 $(this).find('.btn-filter').each(function(){ 333 let _btn = $(this); 334 let filter = _btn.attr('data-filter'); 335 let items = _btn.parents('.gva-portfolio-grid').find('.isotope-items').first(); 336 _btn.find('.count').first().html('[' + items.find('> ' + filter).length + ']'); 337 }); 338 }); 339 340 } 341 } 342 343 $(document).ready(function(){ 344 GaviasTheme.init(); 345 }) 346 347 $(window).load(function(){ 348 GaviasTheme.carouselProductThumbnail(); 349 }) 350 351})(jQuery);
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.