MOBILE-3063 reading: Avoid collapsible heading glitch

main
Pau Ferrer Ocaña 2025-01-14 14:53:43 +01:00
parent 070fbc5cd1
commit 553664ce68
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> { protected async enterReadingMode(): Promise<void> {
this.enabled = true; 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'); document.body.classList.add('core-reading-mode-enabled');
@ -172,11 +172,11 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy {
* Disable the reading mode. * Disable the reading mode.
*/ */
protected async disableReadingMode(): Promise<void> { protected async disableReadingMode(): Promise<void> {
await this.header?.setEnabled(true);
this.enabled = false; this.enabled = false;
document.body.classList.remove('core-reading-mode-enabled'); document.body.classList.remove('core-reading-mode-enabled');
this.header?.setEnabled(true);
// Enable all styles in element. // Enable all styles in element.
this.disabledStyles.forEach((style) => { this.disabledStyles.forEach((style) => {
style.disabled = false; style.disabled = false;