Skip to content

Commit

Permalink
wrap stuff in try-catch.. yes, stuff, sue me
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghettiwews committed Oct 3, 2018
1 parent 583466d commit 3287fd1
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions website/static/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
document.addEventListener('DOMContentLoaded', function() {

var subTitle = document.querySelector('.projectTitle > small').innerText;
var subSegments = subTitle.split(' ');
var newSub = '';
try {
var subTitle = document.querySelector('.projectTitle > small').innerText;
var subSegments = subTitle.split(' ');
var newSub = '';

subSegments.forEach(function(i){
if (i === '#GetPaid') {
newSub += '<span>' + i + '</span>';
}
else {
newSub += i + ' ';
subSegments.forEach(function(i){
if (i === '#GetPaid') {
newSub += '<span>' + i + '</span>';
}
else {
newSub += i + ' ';
}
});

document.querySelector('.projectTitle > small').innerHTML = newSub;
}
});
catch (error) {

document.querySelector('.projectTitle > small').innerHTML = newSub;
}

// TODO: Refactor this vomit of tabs code. Can definitely be better written, this shyte
let parentTabLinks = document.querySelectorAll('ul.tabs > li');
Expand Down

0 comments on commit 3287fd1

Please sign in to comment.