diff --git a/src/core/mainmenu/pages/menu/menu.ts b/src/core/mainmenu/pages/menu/menu.ts index a9fc4de25..19b2bc3cf 100644 --- a/src/core/mainmenu/pages/menu/menu.ts +++ b/src/core/mainmenu/pages/menu/menu.ts @@ -56,6 +56,10 @@ export class CoreMainMenuPage implements OnDestroy { this.showTabs = true; this.subscription = this.menuDelegate.getHandlers().subscribe((handlers) => { + // Remove the handlers that should only appear in the More menu. + handlers = handlers.filter((handler) => { + return !handler.onlyInMore; + }); handlers = handlers.slice(0, CoreMainMenuProvider.NUM_MAIN_HANDLERS); // Get main handlers. // Re-build the list of tabs. If a handler is already in the list, use existing object to prevent re-creating the tab. diff --git a/src/core/mainmenu/pages/more/more.ts b/src/core/mainmenu/pages/more/more.ts index b3a4f6608..869b7f9ed 100644 --- a/src/core/mainmenu/pages/more/more.ts +++ b/src/core/mainmenu/pages/more/more.ts @@ -57,7 +57,19 @@ export class CoreMainMenuMorePage implements OnDestroy { ionViewDidLoad(): void { // Load the handlers. this.subscription = this.menuDelegate.getHandlers().subscribe((handlers) => { - this.handlers = handlers.slice(CoreMainMenuProvider.NUM_MAIN_HANDLERS); // Remove the main handlers. + // Calculate the main handlers to not display them in this view. + const mainHandlers = handlers.filter((handler) => { + return !handler.onlyInMore; + }).slice(0, CoreMainMenuProvider.NUM_MAIN_HANDLERS); + + // Get only the handlers that don't appear in the main view. + this.handlers = []; + handlers.forEach((handler) => { + if (mainHandlers.indexOf(handler) == -1) { + this.handlers.push(handler); + } + }); + this.handlersLoaded = this.menuDelegate.areHandlersLoaded(); }); } diff --git a/src/core/mainmenu/providers/delegate.ts b/src/core/mainmenu/providers/delegate.ts index cc6c39a04..9f7ea3bdf 100644 --- a/src/core/mainmenu/providers/delegate.ts +++ b/src/core/mainmenu/providers/delegate.ts @@ -88,6 +88,12 @@ export interface CoreMainMenuHandlerData { * @type {any} */ pageParams?: any; + + /** + * Whether the handler should only appear in More menu. + * @type {boolean} + */ + onlyInMore?: boolean; } /** diff --git a/src/core/siteplugins/classes/handlers/main-menu-handler.ts b/src/core/siteplugins/classes/handlers/main-menu-handler.ts index 09dc3c188..db47e3598 100644 --- a/src/core/siteplugins/classes/handlers/main-menu-handler.ts +++ b/src/core/siteplugins/classes/handlers/main-menu-handler.ts @@ -25,8 +25,7 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i protected initResult: any) { super(name); - // Set 699 as max priority so site plugins are always shown in the More tab (700 is Notifications tab). - this.priority = Math.min(handlerSchema.priority, 699); + this.priority = handlerSchema.priority; } /** @@ -45,7 +44,8 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i component: this.plugin.component, method: this.handlerSchema.method, initResult: this.initResult - } + }, + onlyInMore: true }; } }