diff options
author | 2023-07-22 10:53:19 +0200 | |
---|---|---|
committer | 2023-07-22 10:53:19 +0200 | |
commit | b38923f4dbe4bcb99a4a1374b24ae0a8c430e273 (patch) | |
tree | b6992dd49b78f2039a14220b0e61ef18c6e041b2 /source/features/hide-navigation-hover-highlight.tsx | |
parent | d1f2239771dd915b0d2f4fe9b0491760ce87e456 (diff) | |
download | refined-github-b38923f4dbe4bcb99a4a1374b24ae0a8c430e273.tar.gz refined-github-b38923f4dbe4bcb99a4a1374b24ae0a8c430e273.tar.zst refined-github-b38923f4dbe4bcb99a4a1374b24ae0a8c430e273.zip |
Restore `hide-navigation-hover-highlight` on files/notifications (#6779)
Diffstat (limited to '')
-rw-r--r-- | source/features/hide-navigation-hover-highlight.tsx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source/features/hide-navigation-hover-highlight.tsx b/source/features/hide-navigation-hover-highlight.tsx index 792cf491..b30dc30e 100644 --- a/source/features/hide-navigation-hover-highlight.tsx +++ b/source/features/hide-navigation-hover-highlight.tsx @@ -1,17 +1,28 @@ import './hide-navigation-hover-highlight.css'; -import onetime from 'onetime'; import features from '../feature-manager.js'; const className = 'rgh-no-navigation-highlight'; +const html = document.documentElement; function init(): void { - document.documentElement.classList.add(className); - document.documentElement.addEventListener('navigation:keydown', () => { - document.documentElement.classList.remove(className); + html.classList.add(className); + html.addEventListener('navigation:focus', () => { + html.classList.remove(className); }, {once: true}); } void features.add(import.meta.url, { - init: onetime(init), + init, }); + +/* + +Test URLs + +- Notifications list: https://github.com/notifications +- Issue list: https://github.com/refined-github/refined-github/issues +- React file list: https://github.com/refined-github/refined-github/tree/main/.github +- File list: https://github.com/refined-github/refined-github + +*/ |