Skip to content

Commit

Permalink
Merge pull request #31 from kg6zvp/fix_null_pointer_crash
Browse files Browse the repository at this point in the history
fix null pointer crash in main.js
  • Loading branch information
chrisbobbe authored Jan 29, 2020
2 parents 5720ca4 + 58b4112 commit 6624d9f
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,29 @@
var $nav_a = $('#nav a.scrolly');

// Scrolly-fy links.
$nav_a
.scrolly()
.on('click', function(e) {
if($nav_a.scrolly()){
$nav_a
.scrolly()
.on('click', function(e) {

var t = $(this),
href = t.attr('href');
var t = $(this),
href = t.attr('href');

if (href[0] != '#')
return;
if (href[0] != '#')
return;

e.preventDefault();
e.preventDefault();

// Clear active and lock scrollzer until scrolling has stopped
$nav_a
.removeClass('active')
.addClass('scrollzer-locked');
// Clear active and lock scrollzer until scrolling has stopped
$nav_a
.removeClass('active')
.addClass('scrollzer-locked');

// Set this link to active
t.addClass('active');
// Set this link to active
t.addClass('active');

});
});
}

// Initialize scrollzer.
var ids = [];
Expand Down

0 comments on commit 6624d9f

Please sign in to comment.