mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Set proper darkmode attribute for algolia autocomplete
This commit is contained in:
parent
18eb0467ee
commit
4398b8698c
1 changed files with 6 additions and 0 deletions
|
@ -91,6 +91,9 @@ export default class extends Controller {
|
||||||
_enableDarkmode() {
|
_enableDarkmode() {
|
||||||
//Add data-bs-theme="dark" to the html tag
|
//Add data-bs-theme="dark" to the html tag
|
||||||
document.documentElement.setAttribute('data-bs-theme', 'dark');
|
document.documentElement.setAttribute('data-bs-theme', 'dark');
|
||||||
|
|
||||||
|
//Add data-theme="dark" to the body tag for algolia autocomplete
|
||||||
|
document.body.setAttribute('data-theme', 'dark');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,6 +103,9 @@ export default class extends Controller {
|
||||||
_disableDarkmode() {
|
_disableDarkmode() {
|
||||||
//Set data-bs-theme to light
|
//Set data-bs-theme to light
|
||||||
document.documentElement.setAttribute('data-bs-theme', 'light');
|
document.documentElement.setAttribute('data-bs-theme', 'light');
|
||||||
|
|
||||||
|
//Add data-theme="dark" to the body tag for algolia autocomplete
|
||||||
|
document.body.setAttribute('data-theme', 'light');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue