Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Synchronet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
127
Issues
127
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main
Synchronet
Compare Revisions
1adb2b36b875927b03d34d30449219f111ed6b2d...90412f5113a21f1abc6cc9139517ec494b21dd42
Source
90412f5113a21f1abc6cc9139517ec494b21dd42
Select Git revision
...
Target
1adb2b36b875927b03d34d30449219f111ed6b2d
Select Git revision
Compare
Commits (1)
Fix whoopsie in previous doopsie
· 90412f51
echicken
authored
Feb 17, 2021
90412f51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
webv4/root/js/common.js
webv4/root/js/common.js
+3
-3
No files found.
webv4/root/js/common.js
View file @
90412f51
...
...
@@ -93,13 +93,13 @@ function registerEventListener(scope, callback, params) {
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
// originally based on dark-mode-switch by Christian Oliff
if
(
$
(
'
#darkSwitch
'
).
length
)
{
$
(
'
#darkSwitch
'
).
checked
=
localStorage
.
getItem
(
'
darkSwitch
'
)
||
(
window
.
matchMedia
&&
window
.
matchMedia
(
'
(prefers-color-scheme: dark)
'
).
matches
);
$
(
'
#darkSwitch
'
).
prop
(
'
checked
'
,
localStorage
.
getItem
(
'
darkSwitch
'
)
||
(
window
.
matchMedia
&&
window
.
matchMedia
(
'
(prefers-color-scheme: dark)
'
).
matches
)
);
$
(
'
#darkSwitch
'
).
change
(
resetTheme
);
resetTheme
();
function
resetTheme
()
{
if
(
this
.
checked
)
{
if
(
$
(
'
#darkSwitch
'
).
prop
(
'
checked
'
)
)
{
$
(
'
body
'
).
addClass
(
'
dark
'
);
localStorage
.
setItem
(
'
darkSwitch
'
,
'
dark
'
);
localStorage
.
setItem
(
'
darkSwitch
'
,
true
);
}
else
{
$
(
'
body
'
).
removeClass
(
'
dark
'
);
localStorage
.
removeItem
(
'
darkSwitch
'
);
...
...