diff --git a/src/core/features/settings/pages/general/general.html b/src/core/features/settings/pages/general/general.html index 3c463ffe7..c3de108b3 100644 --- a/src/core/features/settings/pages/general/general.html +++ b/src/core/features/settings/pages/general/general.html @@ -15,7 +15,7 @@

{{ 'core.settings.language' | translate }}

- {{ entry.name }} @@ -24,9 +24,9 @@

{{ 'core.settings.fontsize' | translate }}

- - + + {{ 'core.settings.fontsizecharacter' | translate }} @@ -40,7 +40,7 @@

{{ 'core.settings.colorscheme' | translate }}

{{ 'core.settings.forcedsetting' | translate }}

- {{ 'core.settings.colorscheme-' + scheme | translate }} @@ -56,13 +56,13 @@

{{ 'core.settings.enablerichtexteditor' | translate }}

{{ 'core.settings.enablerichtexteditordescription' | translate }}

- +

{{ 'core.settings.ioscookies' | translate }}

{{ 'core.settings.ioscookiesdescription' | translate }}

- + {{ 'core.opensettings' | translate }}
@@ -72,14 +72,14 @@

{{ 'core.settings.debugdisplay' | translate }}

{{ 'core.settings.debugdisplaydescription' | translate }}

- +

{{ 'core.settings.enablefirebaseanalytics' | translate }}

{{ 'core.settings.enablefirebaseanalyticsdescription' | translate }}

- +
diff --git a/src/core/features/settings/pages/general/general.ts b/src/core/features/settings/pages/general/general.ts index 31ecf47e6..04d0db1ce 100644 --- a/src/core/features/settings/pages/general/general.ts +++ b/src/core/features/settings/pages/general/general.ts @@ -111,8 +111,13 @@ export class CoreSettingsGeneralPage { /** * Called when a new language is selected. + * + * @param ev: Event */ - async languageChanged(): Promise { + async languageChanged(ev: Event): Promise { + ev.stopPropagation(); + ev.preventDefault(); + const previousLanguage = await CoreLang.getCurrentLanguage(); if (this.selectedLanguage === previousLanguage) { // Prevent opening again. @@ -177,8 +182,16 @@ export class CoreSettingsGeneralPage { /** * Called when a new zoom level is selected. + * + * @param ev: Event + * @param value: New value */ - zoomLevelChanged(): void { + zoomLevelChanged(ev: Event, value: CoreZoomLevel): void { + ev.stopPropagation(); + ev.preventDefault(); + + this.selectedZoomLevel = value; + this.zoomLevels = this.zoomLevels.map((fontSize) => { fontSize.selected = fontSize.value === this.selectedZoomLevel; @@ -191,31 +204,51 @@ export class CoreSettingsGeneralPage { /** * Called when a new color scheme is selected. + * + * @param ev: Event */ - colorSchemeChanged(): void { + colorSchemeChanged(ev: Event): void { + ev.stopPropagation(); + ev.preventDefault(); + CoreSettingsHelper.setColorScheme(this.selectedScheme); CoreConfig.set(CoreConstants.SETTINGS_COLOR_SCHEME, this.selectedScheme); } /** * Called when the rich text editor is enabled or disabled. + * + * @param ev: Event */ - richTextEditorChanged(): void { + richTextEditorChanged(ev: Event): void { + ev.stopPropagation(); + ev.preventDefault(); + CoreConfig.set(CoreConstants.SETTINGS_RICH_TEXT_EDITOR, this.richTextEditor ? 1 : 0); } /** * Called when the debug display setting is enabled or disabled. + * + * @param ev: Event */ - debugDisplayChanged(): void { + debugDisplayChanged(ev: Event): void { + ev.stopPropagation(); + ev.preventDefault(); + CoreConfig.set(CoreConstants.SETTINGS_DEBUG_DISPLAY, this.debugDisplay ? 1 : 0); CoreDomUtils.setDebugDisplay(this.debugDisplay); } /** * Called when the analytics setting is enabled or disabled. + * + * @param ev: Event */ - async analyticsEnabledChanged(): Promise { + async analyticsEnabledChanged(ev: Event): Promise { + ev.stopPropagation(); + ev.preventDefault(); + await CorePushNotifications.enableAnalytics(this.analyticsEnabled); CoreConfig.set(CoreConstants.SETTINGS_ANALYTICS_ENABLED, this.analyticsEnabled ? 1 : 0); @@ -223,8 +256,13 @@ export class CoreSettingsGeneralPage { /** * Open native settings. + * + * @param ev: Event */ - openNativeSettings(): void { + openNativeSettings(ev: Event): void { + ev.stopPropagation(); + ev.preventDefault(); + Diagnostic.switchToSettings(); }