Skip to content

Commit

Permalink
initialize navigation bullets only when there are more than one hero …
Browse files Browse the repository at this point in the history
…blocks
  • Loading branch information
razwan committed Dec 3, 2019
1 parent c3e0595 commit 68141e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2263,9 +2263,10 @@ var hasTouchScreen = function hasTouchScreen() {
(function ($, window, undefined) {
$(function () {
var $body = $('body');
var shouldHaveBullets = $body.is('.novablocks-has-position-indicators') && $('.novablocks-hero').length > 1;
parallaxInit('novablocks-hero');

if ($body.is('.novablocks-has-position-indicators') && typeof $.fn.bully !== 'undefined') {
if (shouldHaveBullets && typeof $.fn.bully !== 'undefined') {
$('.novablocks-hero').bully();
}

Expand Down
2 changes: 1 addition & 1 deletion dist/js/frontend.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/blocks/hero/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { parallaxInit } from "../../utils";

$(function() {
const $body = $( 'body' );
const shouldHaveBullets = $body.is( '.novablocks-has-position-indicators' ) && $( '.novablocks-hero' ).length > 1;
parallaxInit( 'novablocks-hero' );

if ( $body.is( '.novablocks-has-position-indicators' ) && typeof $.fn.bully !== 'undefined' ) {
if ( shouldHaveBullets && typeof $.fn.bully !== 'undefined' ) {
$( '.novablocks-hero' ).bully();
}

Expand Down

0 comments on commit 68141e2

Please sign in to comment.