fix: JavaScript on mobile detection

The result of `getPropertyValue` is a string, so it evaluates to
true without regard to the value. Changed to actually check if the
value is exactly `'1'`
This commit is contained in:
Emilia Allison 2022-01-22 12:29:37 -05:00
parent d2bf4e64a4
commit 2bcd585898
Signed by: emilia
GPG Key ID: 71D938CBB74EF7EA
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ const is_mobile = getComputedStyle(document.body).getPropertyValue('--is-mobile'
const pgp_p = document.getElementById('pgp_p') const pgp_p = document.getElementById('pgp_p')
const pgp_a = document.getElementById('pgp_a') const pgp_a = document.getElementById('pgp_a')
if (is_mobile) { if (is_mobile === '1') {
pgp_a.style.display = "block"; pgp_a.style.display = "block";
} else { } else {
pgp_p.onmouseover = function() {pgp_a.style.display = "inline";} pgp_p.onmouseover = function() {pgp_a.style.display = "inline";}