Skip to content

Commit

Permalink
Allow tab focus on dark/light toggle button
Browse files Browse the repository at this point in the history
For the HTML output when HTML_COLORSTYLE is set to TOGGLE.
  • Loading branch information
doxygen committed Jul 31, 2023
1 parent db82b05 commit dcbea1c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/html/darkmode_toggle.js
Expand Up @@ -57,6 +57,7 @@ class DarkModeToggle extends HTMLElement {
const toggleButton = document.createElement('dark-mode-toggle')
toggleButton.title = DarkModeToggle.title
toggleButton.innerHTML = DarkModeToggle.icon
toggleButton.tabIndex = 0;

function addButton() {
var titleArea = document.getElementById("titlearea");
Expand Down Expand Up @@ -121,6 +122,7 @@ class DarkModeToggle extends HTMLElement {
constructor() {
super();
this.onclick=this.toggleDarkMode
this.onkeypress=function(e){if (e.keyCode==13) { this.toggleDarkMode(); }};
}

static createCookie(name, value, days) {
Expand Down

0 comments on commit dcbea1c

Please sign in to comment.