From 2ee117f935057c9ee130ba3a9c76f565a2b647b3 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 30 Jan 2018 14:43:05 +0100 Subject: [PATCH] MOBILE-2324 user: Fix user profile navigation --- src/components/split-view/split-view.ts | 24 +++++++++++- src/core/user/pages/profile/profile.html | 8 ++-- src/core/user/pages/profile/profile.ts | 34 ++++++++++++++--- src/core/user/providers/user-delegate.ts | 47 ++++++++++++++++++++---- src/core/user/providers/user-handler.ts | 6 +-- 5 files changed, 97 insertions(+), 22 deletions(-) diff --git a/src/components/split-view/split-view.ts b/src/components/split-view/split-view.ts index 51056847b..5d4709d20 100644 --- a/src/components/split-view/split-view.ts +++ b/src/components/split-view/split-view.ts @@ -66,6 +66,28 @@ export class CoreSplitViewComponent implements OnInit { this.emptyDetails(); } + /** + * Get the details NavController. If split view is not enabled, it will return the master nav. + * + * @return {NavController} Details NavController. + */ + getDetailsNav(): NavController { + if (this.isEnabled) { + return this.detailNav; + } else { + return this.masterNav; + } + } + + /** + * Get the master NavController. + * + * @return {NavController} Master NavController. + */ + getMasterNav(): NavController { + return this.masterNav; + } + /** * Check if both panels are shown. It depends on screen width. * @@ -81,7 +103,7 @@ export class CoreSplitViewComponent implements OnInit { * @param {any} page The component class or deeplink name you want to push onto the navigation stack. * @param {any} params Any NavParams you want to pass along to the next view. */ - push(page: any, params?: any, element?: HTMLElement): void { + push(page: any, params?: any): void { if (this.isEnabled) { this.detailNav.setRoot(page, params); } else { diff --git a/src/core/user/pages/profile/profile.html b/src/core/user/pages/profile/profile.html index fda94e955..ae17d5f1d 100644 --- a/src/core/user/pages/profile/profile.html +++ b/src/core/user/pages/profile/profile.html @@ -26,7 +26,7 @@ - +

{{comHandler.title | translate}}

@@ -37,7 +37,7 @@
- +

{{ 'core.user.details' | translate }}

@@ -45,13 +45,13 @@ - +

{{ npHandler.title | translate }}

-