Skip to content

Commit

Permalink
prevent default on toggle dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 22, 2023
1 parent cc219a6 commit b57bb25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/layouts/plain/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
}
}
toggleDarkMode() {
toggleDarkMode(e) {
e.preventDefault()
if (this.element.classList.toggle('dark')) {
localStorage.setItem('dark-mode', 'enabled');
} else {
Expand Down

0 comments on commit b57bb25

Please sign in to comment.