Merge pull request #4285 from crazyserver/MOBILE-3063

MOBILE-3063 reading: Avoid collapsible heading glitch
main
Dani Palou 2025-01-14 15:24:37 +01:00 committed by GitHub
commit 9ad916588b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -132,9 +132,9 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy {
*/
protected async enterReadingMode(): Promise<void> {
this.enabled = true;
CoreViewer.loadReadingModeSettings();
await CoreViewer.loadReadingModeSettings();
this.header?.setEnabled(false);
await this.header?.setEnabled(false);
document.body.classList.add('core-reading-mode-enabled');
@ -172,11 +172,11 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy {
* Disable the reading mode.
*/
protected async disableReadingMode(): Promise<void> {
await this.header?.setEnabled(true);
this.enabled = false;
document.body.classList.remove('core-reading-mode-enabled');
this.header?.setEnabled(true);
// Enable all styles in element.
this.disabledStyles.forEach((style) => {
style.disabled = false;