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:
parent
d2bf4e64a4
commit
2bcd585898
|
@ -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";}
|
||||||
|
|
Loading…
Reference in New Issue