MOBILE-2324 splitview: Fix splitview deactivation
parent
2ee117f935
commit
c6032d76ed
|
@ -20,7 +20,7 @@
|
||||||
<core-empty-box *ngIf="!filteredEvents || !filteredEvents.length" icon="calendar" [message]="'addon.calendar.noevents' | translate">
|
<core-empty-box *ngIf="!filteredEvents || !filteredEvents.length" icon="calendar" [message]="'addon.calendar.noevents' | translate">
|
||||||
</core-empty-box>
|
</core-empty-box>
|
||||||
|
|
||||||
<ion-list *ngIf="filteredEvents && filteredEvents.length">
|
<ion-list *ngIf="filteredEvents && filteredEvents.length" no-margin>
|
||||||
<a ion-item text-wrap *ngFor="let event of filteredEvents" [title]="event.name" (click)="gotoEvent(event.id)" [class.core-split-item-selected]="event.id == eventId">
|
<a ion-item text-wrap *ngFor="let event of filteredEvents" [title]="event.name" (click)="gotoEvent(event.id)" [class.core-split-item-selected]="event.id == eventId">
|
||||||
<img *ngIf="event.moduleIcon" src="{{event.moduleIcon}}" item-start class="core-module-icon">
|
<img *ngIf="event.moduleIcon" src="{{event.moduleIcon}}" item-start class="core-module-icon">
|
||||||
<ion-icon *ngIf="!event.moduleIcon" name="{{event.icon}}" item-start></ion-icon>
|
<ion-icon *ngIf="!event.moduleIcon" name="{{event.icon}}" item-start></ion-icon>
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class CoreNavBarButtonsComponent implements OnInit {
|
||||||
selector += '[end]';
|
selector += '[end]';
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonsContainer = header.querySelector(selector);
|
buttonsContainer = <HTMLElement> header.querySelector(selector);
|
||||||
if (buttonsContainer) {
|
if (buttonsContainer) {
|
||||||
this.domUtils.moveChildren(this.element, buttonsContainer);
|
this.domUtils.moveChildren(this.element, buttonsContainer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,3 +37,15 @@ core-split-view {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ios ion-header + core-split-view ion-menu.split-pane-side ion-content{
|
||||||
|
top: $navbar-ios-height;
|
||||||
|
}
|
||||||
|
|
||||||
|
.md ion-header + core-split-view ion-menu.split-pane-side ion-content{
|
||||||
|
top: $navbar-md-height;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp ion-header + core-split-view ion-menu.split-pane-side ion-content{
|
||||||
|
top: $navbar-wp-height;
|
||||||
|
}
|
|
@ -47,6 +47,7 @@ export class CoreSplitViewComponent implements OnInit {
|
||||||
@Input() when?: string | boolean = 'md';
|
@Input() when?: string | boolean = 'md';
|
||||||
protected isEnabled = false;
|
protected isEnabled = false;
|
||||||
protected masterPageName = '';
|
protected masterPageName = '';
|
||||||
|
protected masterPageIndex = 0;
|
||||||
protected loadDetailPage: any = false;
|
protected loadDetailPage: any = false;
|
||||||
protected element: HTMLElement; // Current element.
|
protected element: HTMLElement; // Current element.
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ export class CoreSplitViewComponent implements OnInit {
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
// Get the master page name and set an empty page as a placeholder.
|
// Get the master page name and set an empty page as a placeholder.
|
||||||
this.masterPageName = this.masterNav.getActive().component.name;
|
this.masterPageName = this.masterNav.getActive().component.name;
|
||||||
|
this.masterPageIndex = this.masterNav.indexOf(this.masterNav.getActive());
|
||||||
this.emptyDetails();
|
this.emptyDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +143,7 @@ export class CoreSplitViewComponent implements OnInit {
|
||||||
activateSplitView(): void {
|
activateSplitView(): void {
|
||||||
const currentView = this.masterNav.getActive(),
|
const currentView = this.masterNav.getActive(),
|
||||||
currentPageName = currentView.component.name;
|
currentPageName = currentView.component.name;
|
||||||
|
if (this.masterNav.getPrevious().component.name == this.masterPageName) {
|
||||||
if (currentPageName != this.masterPageName) {
|
if (currentPageName != this.masterPageName) {
|
||||||
// CurrentView is a 'Detail' page remove it from the 'master' nav stack.
|
// CurrentView is a 'Detail' page remove it from the 'master' nav stack.
|
||||||
this.masterNav.pop();
|
this.masterNav.pop();
|
||||||
|
@ -153,6 +156,7 @@ export class CoreSplitViewComponent implements OnInit {
|
||||||
}
|
}
|
||||||
this.loadDetailPage = false;
|
this.loadDetailPage = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disabled the split view, show only one panel and do some magical navigation.
|
* Disabled the split view, show only one panel and do some magical navigation.
|
||||||
|
@ -162,7 +166,7 @@ export class CoreSplitViewComponent implements OnInit {
|
||||||
currentPageName = detailView.component.name;
|
currentPageName = detailView.component.name;
|
||||||
if (currentPageName != 'CoreSplitViewPlaceholderPage') {
|
if (currentPageName != 'CoreSplitViewPlaceholderPage') {
|
||||||
// Current detail view is a 'Detail' page so, not the placeholder page, push it on 'master' nav stack.
|
// Current detail view is a 'Detail' page so, not the placeholder page, push it on 'master' nav stack.
|
||||||
this.masterNav.push(detailView.component, detailView.data);
|
this.masterNav.insert(this.masterPageIndex + 1, detailView.component, detailView.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,13 +60,8 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges {
|
||||||
protected tabsShown = true;
|
protected tabsShown = true;
|
||||||
protected scroll: HTMLElement; // Parent scroll element (if core-tabs is inside a ion-content).
|
protected scroll: HTMLElement; // Parent scroll element (if core-tabs is inside a ion-content).
|
||||||
|
|
||||||
constructor(element: ElementRef, content: Content) {
|
constructor(element: ElementRef, protected content: Content) {
|
||||||
this.tabBarElement = element.nativeElement;
|
this.tabBarElement = element.nativeElement;
|
||||||
setTimeout(() => {
|
|
||||||
if (content) {
|
|
||||||
this.scroll = content.getScrollElement();
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,9 +163,12 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges {
|
||||||
// Setup tab scrolling.
|
// Setup tab scrolling.
|
||||||
this.tabBarHeight = this.topTabsElement.offsetHeight;
|
this.tabBarHeight = this.topTabsElement.offsetHeight;
|
||||||
this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px';
|
this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px';
|
||||||
|
if (this.content) {
|
||||||
|
this.scroll = this.content.getScrollElement();
|
||||||
if (this.scroll) {
|
if (this.scroll) {
|
||||||
this.scroll.classList.add('no-scroll');
|
this.scroll.classList.add('no-scroll');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<core-empty-box *ngIf="participants && participants.length == 0" icon="person" [message]="'core.user.noparticipants' | translate">
|
<core-empty-box *ngIf="participants && participants.length == 0" icon="person" [message]="'core.user.noparticipants' | translate">
|
||||||
</core-empty-box>
|
</core-empty-box>
|
||||||
|
|
||||||
<ion-list *ngIf="participants && participants.length > 0">
|
<ion-list *ngIf="participants && participants.length > 0" no-margin>
|
||||||
<a ion-item text-wrap *ngFor="let participant of participants" [title]="participant.fullname" (click)="gotoParticipant(participant.id)" [class.core-split-item-selected]="participant.id == participantId">
|
<a ion-item text-wrap *ngFor="let participant of participants" [title]="participant.fullname" (click)="gotoParticipant(participant.id)" [class.core-split-item-selected]="participant.id == participantId">
|
||||||
<ion-avatar item-start>
|
<ion-avatar item-start>
|
||||||
<img src="{{participant.profileimageurl}}" [alt]="'core.pictureof' | translate:{$a: participant.fullname}" core-external-content>
|
<img src="{{participant.profileimageurl}}" [alt]="'core.pictureof' | translate:{$a: participant.fullname}" core-external-content>
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class CoreUserParticipantsComponent implements OnInit {
|
||||||
this.gotoParticipant(this.participants[0].id);
|
this.gotoParticipant(this.participants[0].id);
|
||||||
}
|
}
|
||||||
// Add log in Moodle.
|
// Add log in Moodle.
|
||||||
this.userProvider.logView(this.courseId).catch(() => {
|
this.userProvider.logParticipantsView(this.courseId).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component, Optional } from '@angular/core';
|
||||||
import { IonicPage, NavParams, NavController } from 'ionic-angular';
|
import { IonicPage, NavParams, NavController } from 'ionic-angular';
|
||||||
import { CoreUserProvider } from '../../providers/user';
|
import { CoreUserProvider } from '../../providers/user';
|
||||||
import { CoreUserHelperProvider } from '../../providers/helper';
|
import { CoreUserHelperProvider } from '../../providers/helper';
|
||||||
|
@ -54,7 +54,8 @@ export class CoreUserProfilePage {
|
||||||
private domUtils: CoreDomUtilsProvider, private translate: TranslateService, private eventsProvider: CoreEventsProvider,
|
private domUtils: CoreDomUtilsProvider, private translate: TranslateService, private eventsProvider: CoreEventsProvider,
|
||||||
private coursesProvider: CoreCoursesProvider, private sitesProvider: CoreSitesProvider,
|
private coursesProvider: CoreCoursesProvider, private sitesProvider: CoreSitesProvider,
|
||||||
private mimetypeUtils: CoreMimetypeUtilsProvider, private fileUploaderHelper: CoreFileUploaderHelperProvider,
|
private mimetypeUtils: CoreMimetypeUtilsProvider, private fileUploaderHelper: CoreFileUploaderHelperProvider,
|
||||||
private userDelegate: CoreUserDelegate, private svComponent: CoreSplitViewComponent, private navCtrl: NavController) {
|
private userDelegate: CoreUserDelegate, private navCtrl: NavController,
|
||||||
|
@Optional() private svComponent: CoreSplitViewComponent) {
|
||||||
this.userId = navParams.get('userId');
|
this.userId = navParams.get('userId');
|
||||||
this.courseId = navParams.get('courseId');
|
this.courseId = navParams.get('courseId');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue