Skip to content

Commit e3308f7

Browse files
Confirmation for changing theme (#4313)
* add confirmation textMsg for theme change * update textMsg * localize the string with _() * localize only the string * Replaced string concatenation with template literals
1 parent 55392e6 commit e3308f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/toolbar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,12 @@ class Toolbar {
463463
const darkModeIcon = docById("darkModeIcon");
464464

465465
darkModeIcon.onclick = () => {
466-
onclick();
466+
this.activity.textMsg(`<div id="theme-link" onmouseover="this.style.opacity=0.5" onmouseout="this.style.opacity=1"> ${_("Refresh your browser to change your theme.")} </div>`);
467+
468+
const themeLink = docById("theme-link");
469+
themeLink.addEventListener( "click", () => {
470+
onclick();
471+
})
467472
}
468473
}
469474

0 commit comments

Comments
 (0)