mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-25 18:41:05 +00:00
Fix dark theme handling scrolling to the top
This commit is contained in:
parent
6a3140f2f7
commit
974ff07076
3 changed files with 8 additions and 5 deletions
|
@ -89,7 +89,8 @@ function darkTheme() {
|
||||||
preferedColorScheme.init();
|
preferedColorScheme.init();
|
||||||
const lightThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="light"]');
|
const lightThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="light"]');
|
||||||
[...lightThemeButtons].map((lightThemeButton) => {
|
[...lightThemeButtons].map((lightThemeButton) => {
|
||||||
lightThemeButton.addEventListener('click', () => {
|
lightThemeButton.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
themeDom.removeClass(rootEl);
|
themeDom.removeClass(rootEl);
|
||||||
themeCookie.setCookie(false);
|
themeCookie.setCookie(false);
|
||||||
});
|
});
|
||||||
|
@ -97,7 +98,8 @@ function darkTheme() {
|
||||||
});
|
});
|
||||||
const darkThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="dark"]');
|
const darkThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="dark"]');
|
||||||
[...darkThemeButtons].map((darkThemeButton) => {
|
[...darkThemeButtons].map((darkThemeButton) => {
|
||||||
darkThemeButton.addEventListener('click', () => {
|
darkThemeButton.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
themeDom.addClass(rootEl);
|
themeDom.addClass(rootEl);
|
||||||
themeCookie.setCookie(true);
|
themeCookie.setCookie(true);
|
||||||
});
|
});
|
||||||
|
@ -105,7 +107,8 @@ function darkTheme() {
|
||||||
});
|
});
|
||||||
const autoThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="auto"]');
|
const autoThemeButtons = document.querySelectorAll('.js-theme-toggle[data-theme="auto"]');
|
||||||
[...autoThemeButtons].map((autoThemeButton) => {
|
[...autoThemeButtons].map((autoThemeButton) => {
|
||||||
autoThemeButton.addEventListener('click', () => {
|
autoThemeButton.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
themeCookie.removeCookie();
|
themeCookie.removeCookie();
|
||||||
preferedColorScheme.choose();
|
preferedColorScheme.choose();
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue