|
1 | 1 | (function( $ ) {// jscs:ignore validateLineBreaks |
2 | 2 |
|
3 | | - var clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval, |
| 3 | + let clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval, |
4 | 4 | shapelyCf, element, newURL, scrollToID; |
5 | 5 |
|
6 | 6 | jQuery( document ).ready( function( $ ) { |
|
19 | 19 |
|
20 | 20 | // Smooth scroll to inner links |
21 | 21 | jQuery( '.inner-link' ).each( function() { |
22 | | - var href = jQuery( this ).attr( 'href' ); |
| 22 | + let href = jQuery( this ).attr( 'href' ); |
23 | 23 | if ( '#' !== href.charAt( 0 ) ) { |
24 | 24 | jQuery( this ).removeClass( 'inner-link' ); |
25 | 25 | } |
|
51 | 51 | } |
52 | 52 |
|
53 | 53 | $( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) { |
54 | | - var scrollToID = '#' + $( this ).data( 'scroll' ); |
| 54 | + let scrollToID = '#' + $( this ).data( 'scroll' ); |
55 | 55 |
|
56 | 56 | if ( jQuery( scrollToID ).length > 1 ) { |
57 | 57 | scrollToID = $( this ).attr( 'href' ); |
|
77 | 77 | // Append .background-image-holder <img>'s as CSS backgrounds |
78 | 78 |
|
79 | 79 | jQuery( '.background-image-holder' ).each( function() { |
80 | | - var imgSrc = jQuery( this ).children( 'img' ).attr( 'src' ); |
| 80 | + let imgSrc = jQuery( this ).children( 'img' ).attr( 'src' ); |
81 | 81 | jQuery( this ).css( 'background', 'url("' + imgSrc + '")' ); |
82 | 82 | jQuery( this ).children( 'img' ).hide(); |
83 | 83 | jQuery( this ).css( 'background-position', 'initial' ); |
|
123 | 123 | } else if ( farRight > $( window ).width() && $( this ).hasClass( 'mega-menu' ) ) { |
124 | 124 | isOnScreen = $( window ).width() - menu.left; |
125 | 125 | difference = $( this ).outerWidth( true ) - isOnScreen; |
126 | | - $( this ).css( 'margin-left', - (difference) ); |
| 126 | + $( this ).css( 'margin-left', -( difference ) ); |
127 | 127 | } |
128 | 128 | } ); |
129 | 129 |
|
|
208 | 208 | } |
209 | 209 | } ); |
210 | 210 | $( '.slider-thumb-controls .slides li' ).each( function() { |
211 | | - var imgSrc = $( this ).find( 'img' ).attr( 'src' ); |
| 211 | + let imgSrc = $( this ).find( 'img' ).attr( 'src' ); |
212 | 212 | $( this ).attr( 'data-thumb', imgSrc ); |
213 | 213 | } ); |
214 | 214 | $( '.slider-thumb-controls' ).flexslider( { |
|
265 | 265 |
|
266 | 266 | // Lightbox gallery titles |
267 | 267 | $( '.lightbox-grid li a' ).each( function() { |
268 | | - var galleryTitle = $( this ).closest( '.lightbox-grid' ).attr( 'data-gallery-title' ); |
| 268 | + let galleryTitle = $( this ).closest( '.lightbox-grid' ).attr( 'data-gallery-title' ); |
269 | 269 | $( this ).attr( 'data-lightbox', galleryTitle ); |
270 | 270 | } ); |
271 | 271 |
|
272 | 272 | videos = $( '.video-widget' ); |
273 | 273 | if ( videos.length ) { |
274 | 274 | $.each( videos, function() { |
275 | | - var play = $( this ).find( '.play-button' ), |
| 275 | + let play = $( this ).find( '.play-button' ), |
276 | 276 | pause = $( this ).find( '.pause-button' ), |
277 | 277 | isYoutube = $( this ).hasClass( 'youtube' ), |
278 | 278 | isVimeo = $( this ).hasClass( 'vimeo' ), |
|
286 | 286 | fitToBackground: true, |
287 | 287 | videoId: videoId, |
288 | 288 | mute: mute, |
289 | | - playerVars: { |
| 289 | + playerlets: { |
290 | 290 | modestbranding: 0, |
291 | 291 | autoplay: autoplay, |
292 | 292 | controls: 0, |
|
299 | 299 | self = $( this ); |
300 | 300 |
|
301 | 301 | $( document ).on( 'YTBGREADY', function() { |
302 | | - var iframe = self.find( 'iframe' ), |
| 302 | + let iframe = self.find( 'iframe' ), |
303 | 303 | height = iframe.height(); |
304 | 304 | } ); |
305 | 305 |
|
306 | 306 | $( play ).on( 'click', function( e ) { |
307 | | - var parent = $( this ).parents( '.video-widget' ), |
| 307 | + let parent = $( this ).parents( '.video-widget' ), |
308 | 308 | instance = $( parent ).data( 'ytPlayer' ).player; |
309 | 309 | e.preventDefault(); |
310 | 310 | instance.playVideo(); |
311 | 311 | } ); |
312 | 312 |
|
313 | 313 | $( pause ).on( 'click', function( e ) { |
314 | | - var parent = $( this ).parents( '.video-widget' ), |
| 314 | + let parent = $( this ).parents( '.video-widget' ), |
315 | 315 | instance = $( parent ).data( 'ytPlayer' ).player; |
316 | 316 | e.preventDefault(); |
317 | 317 | instance.pauseVideo(); |
|
347 | 347 | } else { |
348 | 348 |
|
349 | 349 | $( play ).on( 'click', function( e ) { |
350 | | - var parent = $( this ).parents( '.video-widget' ), |
| 350 | + let parent = $( this ).parents( '.video-widget' ), |
351 | 351 | instance = $( parent ).data( 'vide' ), |
352 | 352 | video = instance.getVideoObject(); |
353 | 353 | e.preventDefault(); |
354 | 354 | video.play(); |
355 | 355 | } ); |
356 | 356 |
|
357 | 357 | $( pause ).on( 'click', function( e ) { |
358 | | - var parent = $( this ).parents( '.video-widget' ), |
| 358 | + let parent = $( this ).parents( '.video-widget' ), |
359 | 359 | instance = $( parent ).data( 'vide' ), |
360 | 360 | video = instance.getVideoObject(); |
361 | 361 | e.preventDefault(); |
|
376 | 376 |
|
377 | 377 | $( '.owlCarousel' ).each( function( index ) { |
378 | 378 |
|
379 | | - var sliderSelector = '#owlCarousel-' + $( this ).data( 'slider-id' ); // This is the slider selector |
380 | | - var sliderItems = $( this ).data( 'slider-items' ); |
381 | | - var sliderSpeed = $( this ).data( 'slider-speed' ); |
382 | | - var sliderAutoPlay = $( this ).data( 'slider-auto-play' ); |
383 | | - var sliderSingleItem = $( this ).data( 'slider-single-item' ); |
| 379 | + let sliderSelector = '#owlCarousel-' + $( this ).data( 'slider-id' ); // This is the slider selector |
| 380 | + let sliderItems = $( this ).data( 'slider-items' ); |
| 381 | + let sliderSpeed = $( this ).data( 'slider-speed' ); |
| 382 | + let sliderAutoPlay = $( this ).data( 'slider-auto-play' ); |
| 383 | + let sliderSingleItem = $( this ).data( 'slider-single-item' ); |
384 | 384 |
|
385 | 385 | //Conversion of 1 to true & 0 to false |
386 | 386 | // auto play |
387 | | - sliderAutoPlay = ! (0 === sliderAutoPlay || 'false' === sliderAutoPlay); |
| 387 | + sliderAutoPlay = ! ( 0 === sliderAutoPlay || 'false' === sliderAutoPlay ); |
388 | 388 |
|
389 | 389 | // Custom Navigation events outside of the owlCarousel mark-up |
390 | 390 | $( '.shapely-owl-next' ).on( 'click', function( event ) { |
|
451 | 451 |
|
452 | 452 | // "use strict"; |
453 | 453 | // Resetting testimonial parallax height |
454 | | - var msnry, container, clFirstSectionHeight; |
| 454 | + let msnry, container, clFirstSectionHeight; |
455 | 455 | if ( 0 !== jQuery( '.testimonial-section' ).length ) { |
456 | 456 | testimonialHeight(); |
457 | 457 | setTimeout( function() { |
|
489 | 489 | * keep menu fixed |
490 | 490 | **/ |
491 | 491 | function updateNav() { |
492 | | - var scroll = $( window ).scrollTop(); |
493 | | - var windowW = jQuery( window ).width(); |
| 492 | + let scroll = $( window ).scrollTop(); |
| 493 | + let windowW = jQuery( window ).width(); |
494 | 494 |
|
495 | 495 | if ( windowW < 992 ) { |
496 | 496 | return; |
|
500 | 500 | clNav.addClass( 'outOfSight' ); |
501 | 501 | } |
502 | 502 |
|
503 | | - if ( $( window ).scrollTop() > (clNavOuterHeight + 65) ) {//If href = #element id |
| 503 | + if ( $( window ).scrollTop() > ( clNavOuterHeight + 65 ) ) {//If href = #element id |
504 | 504 | clNav.addClass( 'fixed scrolled' ); |
505 | 505 | } |
506 | 506 |
|
|
510 | 510 | } |
511 | 511 |
|
512 | 512 | function masonryFlyIn() { |
513 | | - var $items = jQuery( '.masonryFlyIn .masonry-item' ); |
514 | | - var time = 0; |
| 513 | + let $items = jQuery( '.masonryFlyIn .masonry-item' ); |
| 514 | + let time = 0; |
515 | 515 |
|
516 | 516 | $items.each( function() { |
517 | | - var item = jQuery( this ); |
| 517 | + let item = jQuery( this ); |
518 | 518 | setTimeout( function() { |
519 | 519 | item.addClass( 'fadeIn' ); |
520 | 520 | }, time ); |
|
0 commit comments