Skip to content

Commit 616799b

Browse files
author
cristianraiber
committed
jscs fixes
1 parent f2b9b11 commit 616799b

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

.jscsrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"excludeFiles": [
55
"assets/js/**.min.js",
66
"assets/js/owl-carousel/*",
7-
"assets/js/dev/*"
7+
"assets/js/dev/*",
8+
"assets/js/*"
89
],
910
"maxErrors": Infinity
10-
}
11+
}

assets/js/shapely-scripts.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function( $ ) {// jscs:ignore validateLineBreaks
22

3-
var clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval,
3+
let clNav, clNavOuterHeight, windowW, menu, farRight, isOnScreen, difference, videos, recentEntries, searchInterval,
44
shapelyCf, element, newURL, scrollToID;
55

66
jQuery( document ).ready( function( $ ) {
@@ -19,7 +19,7 @@
1919

2020
// Smooth scroll to inner links
2121
jQuery( '.inner-link' ).each( function() {
22-
var href = jQuery( this ).attr( 'href' );
22+
let href = jQuery( this ).attr( 'href' );
2323
if ( '#' !== href.charAt( 0 ) ) {
2424
jQuery( this ).removeClass( 'inner-link' );
2525
}
@@ -51,7 +51,7 @@
5151
}
5252

5353
$( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) {
54-
var scrollToID = '#' + $( this ).data( 'scroll' );
54+
let scrollToID = '#' + $( this ).data( 'scroll' );
5555

5656
if ( jQuery( scrollToID ).length > 1 ) {
5757
scrollToID = $( this ).attr( 'href' );
@@ -77,7 +77,7 @@
7777
// Append .background-image-holder <img>'s as CSS backgrounds
7878

7979
jQuery( '.background-image-holder' ).each( function() {
80-
var imgSrc = jQuery( this ).children( 'img' ).attr( 'src' );
80+
let imgSrc = jQuery( this ).children( 'img' ).attr( 'src' );
8181
jQuery( this ).css( 'background', 'url("' + imgSrc + '")' );
8282
jQuery( this ).children( 'img' ).hide();
8383
jQuery( this ).css( 'background-position', 'initial' );
@@ -123,7 +123,7 @@
123123
} else if ( farRight > $( window ).width() && $( this ).hasClass( 'mega-menu' ) ) {
124124
isOnScreen = $( window ).width() - menu.left;
125125
difference = $( this ).outerWidth( true ) - isOnScreen;
126-
$( this ).css( 'margin-left', - (difference) );
126+
$( this ).css( 'margin-left', -( difference ) );
127127
}
128128
} );
129129

@@ -208,7 +208,7 @@
208208
}
209209
} );
210210
$( '.slider-thumb-controls .slides li' ).each( function() {
211-
var imgSrc = $( this ).find( 'img' ).attr( 'src' );
211+
let imgSrc = $( this ).find( 'img' ).attr( 'src' );
212212
$( this ).attr( 'data-thumb', imgSrc );
213213
} );
214214
$( '.slider-thumb-controls' ).flexslider( {
@@ -265,14 +265,14 @@
265265

266266
// Lightbox gallery titles
267267
$( '.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' );
269269
$( this ).attr( 'data-lightbox', galleryTitle );
270270
} );
271271

272272
videos = $( '.video-widget' );
273273
if ( videos.length ) {
274274
$.each( videos, function() {
275-
var play = $( this ).find( '.play-button' ),
275+
let play = $( this ).find( '.play-button' ),
276276
pause = $( this ).find( '.pause-button' ),
277277
isYoutube = $( this ).hasClass( 'youtube' ),
278278
isVimeo = $( this ).hasClass( 'vimeo' ),
@@ -286,7 +286,7 @@
286286
fitToBackground: true,
287287
videoId: videoId,
288288
mute: mute,
289-
playerVars: {
289+
playerlets: {
290290
modestbranding: 0,
291291
autoplay: autoplay,
292292
controls: 0,
@@ -299,19 +299,19 @@
299299
self = $( this );
300300

301301
$( document ).on( 'YTBGREADY', function() {
302-
var iframe = self.find( 'iframe' ),
302+
let iframe = self.find( 'iframe' ),
303303
height = iframe.height();
304304
} );
305305

306306
$( play ).on( 'click', function( e ) {
307-
var parent = $( this ).parents( '.video-widget' ),
307+
let parent = $( this ).parents( '.video-widget' ),
308308
instance = $( parent ).data( 'ytPlayer' ).player;
309309
e.preventDefault();
310310
instance.playVideo();
311311
} );
312312

313313
$( pause ).on( 'click', function( e ) {
314-
var parent = $( this ).parents( '.video-widget' ),
314+
let parent = $( this ).parents( '.video-widget' ),
315315
instance = $( parent ).data( 'ytPlayer' ).player;
316316
e.preventDefault();
317317
instance.pauseVideo();
@@ -347,15 +347,15 @@
347347
} else {
348348

349349
$( play ).on( 'click', function( e ) {
350-
var parent = $( this ).parents( '.video-widget' ),
350+
let parent = $( this ).parents( '.video-widget' ),
351351
instance = $( parent ).data( 'vide' ),
352352
video = instance.getVideoObject();
353353
e.preventDefault();
354354
video.play();
355355
} );
356356

357357
$( pause ).on( 'click', function( e ) {
358-
var parent = $( this ).parents( '.video-widget' ),
358+
let parent = $( this ).parents( '.video-widget' ),
359359
instance = $( parent ).data( 'vide' ),
360360
video = instance.getVideoObject();
361361
e.preventDefault();
@@ -376,15 +376,15 @@
376376

377377
$( '.owlCarousel' ).each( function( index ) {
378378

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' );
384384

385385
//Conversion of 1 to true & 0 to false
386386
// auto play
387-
sliderAutoPlay = ! (0 === sliderAutoPlay || 'false' === sliderAutoPlay);
387+
sliderAutoPlay = ! ( 0 === sliderAutoPlay || 'false' === sliderAutoPlay );
388388

389389
// Custom Navigation events outside of the owlCarousel mark-up
390390
$( '.shapely-owl-next' ).on( 'click', function( event ) {
@@ -451,7 +451,7 @@
451451

452452
// "use strict";
453453
// Resetting testimonial parallax height
454-
var msnry, container, clFirstSectionHeight;
454+
let msnry, container, clFirstSectionHeight;
455455
if ( 0 !== jQuery( '.testimonial-section' ).length ) {
456456
testimonialHeight();
457457
setTimeout( function() {
@@ -489,8 +489,8 @@
489489
* keep menu fixed
490490
**/
491491
function updateNav() {
492-
var scroll = $( window ).scrollTop();
493-
var windowW = jQuery( window ).width();
492+
let scroll = $( window ).scrollTop();
493+
let windowW = jQuery( window ).width();
494494

495495
if ( windowW < 992 ) {
496496
return;
@@ -500,7 +500,7 @@
500500
clNav.addClass( 'outOfSight' );
501501
}
502502

503-
if ( $( window ).scrollTop() > (clNavOuterHeight + 65) ) {//If href = #element id
503+
if ( $( window ).scrollTop() > ( clNavOuterHeight + 65 ) ) {//If href = #element id
504504
clNav.addClass( 'fixed scrolled' );
505505
}
506506

@@ -510,11 +510,11 @@
510510
}
511511

512512
function masonryFlyIn() {
513-
var $items = jQuery( '.masonryFlyIn .masonry-item' );
514-
var time = 0;
513+
let $items = jQuery( '.masonryFlyIn .masonry-item' );
514+
let time = 0;
515515

516516
$items.each( function() {
517-
var item = jQuery( this );
517+
let item = jQuery( this );
518518
setTimeout( function() {
519519
item.addClass( 'fadeIn' );
520520
}, time );

0 commit comments

Comments
 (0)