mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 21:54:07 +09:00
Fix admin panel dark mode (#1383)
This commit is contained in:
1 parent
6548ae92e1
commit
985f4bc88c
2 files changed
+6
-4
No files matched your search
@@ -25,15 +25,17 @@ coloris({
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
if (localStorage.getItem('theme') === 'dark') {
|
||||
document.body.classList.add('theme-dark');
|
||||
document.body.setAttribute("data-bs-theme", localStorage.getItem('theme'))
|
||||
} else {
|
||||
document.body.removeAttribute("data-bs-theme")
|
||||
}
|
||||
|
||||
document.querySelectorAll('.js-theme-toggler').forEach(element => {
|
||||
element.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
document.body.classList.toggle('theme-dark');
|
||||
localStorage.setItem('theme', element.getAttribute('href').split('=')[1]);
|
||||
document.body.setAttribute("data-bs-theme", localStorage.getItem('theme'))
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="theme-light">
|
||||
<body data-bs-theme="dark">
|
||||
{% if not admin %}
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
Reference in new issue
Block a user