Skip to content

Commit

Permalink
tweak(js): prevent element errors
Browse files Browse the repository at this point in the history
  • Loading branch information
renzuzu committed Sep 1, 2021
1 parent 468b605 commit 1082f52
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions renzu_hud/ui/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function setArmor(s) {
} else if (status_type !== 'icons') {
SetProgressCircle('armorval', s * 0.99)
}
} else {
} else if(document.getElementById("armorbar")) {
document.getElementById("armorbar").style.width = ''+s * 0.99+'%'
}
}
Expand All @@ -107,7 +107,7 @@ function setHp(s) {
} else if (status_type !== 'icons') {
SetProgressCircle('healthval', s * 0.99)
}
} else {
} else if(document.getElementById("healthbar")) {
document.getElementById("healthbar").style.width = ''+s * 0.99+'%'
var perc = s * 0.99+'%'
//$('#healthbar').velocity({ width: "50px" })
Expand Down Expand Up @@ -3798,8 +3798,13 @@ function setKeyless(table) {

function Talking(bool) {
var voiceId = document.querySelector('#voipsimplebg');
if (bool) { voiceId.classList.add('talking'); }
else { voiceId.classList.remove('talking'); }
if (voiceId) {
if (bool) {
voiceId.classList.add('talking')
} else {
voiceId.classList.remove('talking')
}
}
}

//FUNCTIONS
Expand Down

0 comments on commit 1082f52

Please sign in to comment.