Skip to content

Commit

Permalink
Corrected some small mobile click issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Niyaz-Mohamed committed Aug 30, 2024
1 parent 294ce07 commit c84cf09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/inputs/userInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ document.querySelectorAll(".window").forEach((element) => {
const leftOffset = Math.floor(Math.random() * window.innerWidth * 0.6);

// Set the offsets
element.style.top = mobileTopOffset ? mobileTopOffset : topOffset + "px";
element.style.top = (mobileTopOffset ? mobileTopOffset : topOffset) + "px";
element.style.left = leftOffset + "px";
});

Expand All @@ -91,6 +91,7 @@ function triggerDragElement(element) {
window.innerWidth < 420
? window.innerHeight * 0.25
: window.innerHeight * 0.05;
console.log(minTop, window.innerWidth);

// Check for presence of a header
if (document.getElementById(element.id + "-header")) {
Expand Down Expand Up @@ -151,7 +152,7 @@ document.querySelectorAll(".window-delete").forEach((btn) => {

// Trigger a window to open
document.querySelectorAll(".triggerbtn").forEach((btn) => {
btn.addEventListener("click", () => {
registerEvents(btn, ["click", "touchstart"], () => {
document.getElementById(btn.id.slice(0, -4)).style.display = "block";
});
});
Expand Down

0 comments on commit c84cf09

Please sign in to comment.