mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
edit zenmode to not be persisted
This commit is contained in:
parent
2fdb03f9f5
commit
09bdcb78a2
3 changed files with 10 additions and 8 deletions
|
@ -24,13 +24,14 @@ function _toogleZenMode(zendModeButton) {
|
||||||
|
|
||||||
if (body.classList.contains('zen-mode-enable')) {
|
if (body.classList.contains('zen-mode-enable')) {
|
||||||
// Persist configuration
|
// Persist configuration
|
||||||
localStorage.setItem('blowfish-zen-mode-enabled', 'true');
|
//localStorage.setItem('blowfish-zen-mode-enabled', 'true');
|
||||||
|
|
||||||
// Change title to enable
|
// Change title to enable
|
||||||
zendModeButton.setAttribute('title', titleI18nEnable)
|
zendModeButton.setAttribute('title', titleI18nEnable)
|
||||||
// Auto-scroll to title article
|
// Auto-scroll to title article
|
||||||
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90);
|
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90);
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem('blowfish-zen-mode-enabled', 'false');
|
//localStorage.setItem('blowfish-zen-mode-enabled', 'false');
|
||||||
zendModeButton.setAttribute('title', titleI18nDisable);
|
zendModeButton.setAttribute('title', titleI18nDisable);
|
||||||
document.querySelector('body').scrollIntoView();
|
document.querySelector('body').scrollIntoView();
|
||||||
}
|
}
|
||||||
|
@ -56,10 +57,10 @@ function _registerZendModeButtonClick(zendModeButton) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize localstorage option 'blowfish-zen-mode-enabled' to false, if it does not exist, otherwise enable it.
|
// Initialize localstorage option 'blowfish-zen-mode-enabled' to false, if it does not exist, otherwise enable it.
|
||||||
if (localStorage.getItem('blowfish-zen-mode-enabled') === null) {
|
//if (localStorage.getItem('blowfish-zen-mode-enabled') === null) {
|
||||||
localStorage.setItem('blowfish-zen-mode-enabled', 'false');
|
// localStorage.setItem('blowfish-zen-mode-enabled', 'false');
|
||||||
} else if (localStorage.getItem('blowfish-zen-mode-enabled') === 'true') {
|
//} else if (localStorage.getItem('blowfish-zen-mode-enabled') === 'true') {
|
||||||
_toogleZenMode(zendModeButton)
|
// _toogleZenMode(zendModeButton)
|
||||||
}
|
//}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
|
@ -44,7 +44,7 @@ smartTOCHideUnfocusedChildren = false
|
||||||
showMoreLinkDest = "docs"
|
showMoreLinkDest = "docs"
|
||||||
cardView = false
|
cardView = false
|
||||||
cardViewScreenWidth = false
|
cardViewScreenWidth = false
|
||||||
layoutBackgroundBlur = true # only used when layout equals background
|
layoutBackgroundBlur = false # only used when layout equals background
|
||||||
|
|
||||||
[article]
|
[article]
|
||||||
showDate = false
|
showDate = false
|
||||||
|
|
|
@ -232,6 +232,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
||||||
| `article.showWordCount` | `false` | Whether or not article word counts are displayed. |
|
| `article.showWordCount` | `false` | Whether or not article word counts are displayed. |
|
||||||
| `article.showComments` | `false` | Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer. |
|
| `article.showComments` | `false` | Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer. |
|
||||||
| `article.sharingLinks` | _Not set_ | Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed. Available values are: "linkedin", "twitter", "reddit", "pinterest", "facebook", "email", "whatsapp", and "telegram" |
|
| `article.sharingLinks` | _Not set_ | Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed. Available values are: "linkedin", "twitter", "reddit", "pinterest", "facebook", "email", "whatsapp", and "telegram" |
|
||||||
|
| `article.showZenMode` | `true` | Flag to activate Zen Mode reading feature for articles. |
|
||||||
|
|
||||||
### List
|
### List
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue