Pick themes on settings page, not every page
This hides the paintbrush icon on most pages by default, in preference for the settings on the settings page. When loading from a local file, and not in mobile view, continue to show the theme picker. That's because some browsers limit access to localStorage from file:/// URLs, so choosing a theme from settings.html doesn't take effect.
This commit is contained in:
parent
ad46af2471
commit
c4b994ff80
3 changed files with 12 additions and 12 deletions
|
@ -129,10 +129,15 @@ function hideThemeButtonState() {
|
|||
|
||||
// Set up the theme picker list.
|
||||
(function () {
|
||||
if (!document.location.href.startsWith("file:///")) {
|
||||
return;
|
||||
}
|
||||
var themeChoices = getThemesElement();
|
||||
var themePicker = getThemePickerElement();
|
||||
var availableThemes = getVar("themes").split(",");
|
||||
|
||||
removeClass(themeChoices.parentElement, "hidden");
|
||||
|
||||
function switchThemeButtonState() {
|
||||
if (themeChoices.style.display === "block") {
|
||||
hideThemeButtonState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue