From 2bcd58589890d7c0f2d0baa20711bc6c0f537199 Mon Sep 17 00:00:00 2001 From: Emilia Date: Sat, 22 Jan 2022 12:29:37 -0500 Subject: [PATCH] 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'` --- src/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/index.js b/src/js/index.js index ea0ed68..d0b7a65 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -4,7 +4,7 @@ const is_mobile = getComputedStyle(document.body).getPropertyValue('--is-mobile' const pgp_p = document.getElementById('pgp_p') const pgp_a = document.getElementById('pgp_a') -if (is_mobile) { +if (is_mobile === '1') { pgp_a.style.display = "block"; } else { pgp_p.onmouseover = function() {pgp_a.style.display = "inline";}