Skip to content

Commit

Permalink
Merge pull request #27 from noriyotcp/activate-hotkeys-desktop-only
Browse files Browse the repository at this point in the history
Activate hotkeys on desktop
  • Loading branch information
noriyotcp authored Oct 4, 2024
2 parents a5efee3 + 48a6a33 commit b8daa6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 47 deletions.
37 changes: 0 additions & 37 deletions assets/js/detectOS.js

This file was deleted.

23 changes: 13 additions & 10 deletions assets/js/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ document.addEventListener("DOMContentLoaded", function () {
userAgent.toLowerCase().indexOf("macintosh") !== -1 ||
userAgent.toLowerCase().indexOf("mac os x") !== -1;

// setup to search
const searchIcon = document.querySelector("button.search__toggle");
if (searchIcon) {
if (!isMobile) {
if (!isMobile) {
// setup to search
const searchIcon = document.querySelector("button.search__toggle");
if (searchIcon) {
searchIcon.setAttribute("tooltip", "cmd/ctrl + k to open, esc to close");
searchIcon.setAttribute("tooltip-position", "left");
setupSearchHotkeys(searchIcon, isMac);
}
}

// Register focus hotkeys
setupFocusHotkeys();
// Register focus hotkeys
setupFocusHotkeys();

// Setup hotkeys popover hotkeys
setupHotkeysPopoverHotkeys();
// Setup hotkeys popover hotkeys
setupHotkeysPopoverHotkeys();
} else {
// Hide hotkeys popover on mobile
const hotkeysPopover = document.getElementById("hotkeys-popover");
hotkeysPopover.style.display = "none";
}
});

0 comments on commit b8daa6d

Please sign in to comment.