Skip to content

Commit

Permalink
Firefox tooltip fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNHill committed Jul 2, 2024
1 parent e849f87 commit 9c7bdd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
12 changes: 11 additions & 1 deletion Minesweeper/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ let originalTopHeight = 60
let originalLeftMessage = 185;

let hasTouchScreen = false;
let supportsInputDeviceCapabilities = false;

//variables for left-click flag
let leftClickFlag = false;
Expand Down Expand Up @@ -177,6 +178,14 @@ async function startup() {
document.getElementById("leftClickFlag").style.display = "none";
}

try {
let idc = new InputDeviceCapabilities();
supportsInputDeviceCapabilities = true;
} catch {
supportsInputDeviceCapabilities = false;
}
console.log("Browser supports Input Device Capabilities: " + supportsInputDeviceCapabilities);

//const urlParams = new URLSearchParams(window.location.search);
const testParm = urlParams.get('test');
if (testParm == "y") {
Expand Down Expand Up @@ -2201,7 +2210,8 @@ function followCursor(e) {
//console.log("Follow cursor, touch event? " + e.sourceCapabilities.firesTouchEvents);

// if we got here from a touch event then don't do tool tip
if (e.sourceCapabilities.firesTouchEvents) {
if (supportsInputDeviceCapabilities && e.sourceCapabilities.firesTouchEvents) {
tooltip.innerText = "";
return;
}

Expand Down

0 comments on commit 9c7bdd0

Please sign in to comment.