Skip to content

Commit

Permalink
Merge pull request #19 from noriyotcp/revert-18-disable-tooltip-on-mo…
Browse files Browse the repository at this point in the history
…bile

Revert "Disable tooltip on mobile"
  • Loading branch information
noriyotcp authored Oct 4, 2024
2 parents bde41ea + 5758c56 commit 988b786
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions assets/js/detectOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ export function detectOS() {
return "Unknown";
}

export function isDesktop() {
return detectOS() === "macOS" || detectOS() === "Windows" || detectOS() === "Linux";
}

export function isMobile() {
return detectOS() === "iOS" || detectOS() === "Android";
}
8 changes: 2 additions & 6 deletions assets/js/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isDesktop } from "./detectOS.js";
import { isMobile } from "./detectOS.js";
import { setupFocusHotkeys } from "./setupFocusHotkeys.js";
import { setupSearchHotkeys } from "./setupSearchHotkeys.js";
import { setupHotkeysPopoverHotkeys } from "./setupHotkeysPopoverHotKeys.js";
Expand All @@ -7,13 +7,9 @@ document.addEventListener("DOMContentLoaded", function () {
// setup to search
const searchIcon = document.querySelector("button.search__toggle");
if (searchIcon) {
if (isDesktop()) {
if (!isMobile()) {
searchIcon.setAttribute("tooltip", "cmd/ctrl + k to open, esc to close");
searchIcon.setAttribute("tooltip-position", "left");
} else {
// Disable tooltip on mobile
searchIcon.removeAttribute("tooltip");
searchIcon.removeAttribute("tooltip-position");
}

setupSearchHotkeys(searchIcon);
Expand Down

0 comments on commit 988b786

Please sign in to comment.