MOBILE-4249 ui: Fix context-menu not working in some split view

main
Dani Palou 2023-02-17 11:15:25 +01:00
parent 6b9b956474
commit ffdbf392df
8 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,8 @@
<h1>{{ 'addon.messages.contacts' | translate }}</h1>
</ion-title>
<ion-buttons slot="end">
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
</ion-buttons>
</ion-toolbar>
</ion-header>

View File

@ -10,6 +10,8 @@
<ion-button fill="clear" (click)="gotoSearch()" [attr.aria-label]="'addon.messages.searchcombined' | translate">
<ion-icon name="fas-search" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
</ion-buttons>
</ion-toolbar>
</ion-header>

View File

@ -7,6 +7,8 @@
<h1>{{ 'addon.messages.messages' | translate }}</h1>
</ion-title>
<ion-buttons slot="end">
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
<core-user-menu-button></core-user-menu-button>
</ion-buttons>
</ion-toolbar>

View File

@ -13,6 +13,8 @@
<ion-button (click)="gotoSettings()" [attr.aria-label]="'addon.messages.messagepreferences' | translate">
<ion-icon name="fas-cog" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
<core-user-menu-button></core-user-menu-button>
</ion-buttons>
</ion-toolbar>

View File

@ -7,6 +7,8 @@
<h1>{{ 'addon.messages.searchcombined' | translate }}</h1>
</ion-title>
<ion-buttons slot="end">
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
</ion-buttons>
</ion-toolbar>
</ion-header>

View File

@ -3,6 +3,8 @@
<ion-button fill="clear" (click)="openModuleSummary()" aria-haspopup="true" [attr.aria-label]="'core.info' | translate">
<ion-icon name="fas-info-circle" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<!-- Add an empty context menu so split view pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
</core-navbar-buttons>
<!-- Content. -->

View File

@ -164,6 +164,8 @@ export class CoreNavBarButtonsComponent implements OnInit, OnDestroy {
} else {
// There is a context-menu in these buttons, but there is no main context menu in the header.
// Create one main context menu dynamically.
// @todo: Find a better way to handle header buttons. This isn't working as expected in some cases because the menu
// is destroyed when the page is destroyed, so click listeners stop working.
mainContextMenuInstance = this.createMainContextMenu();
}

View File

@ -13,6 +13,8 @@
<ion-button fill="clear" (click)="openCourseSummary()" [attr.aria-label]="'core.course.coursesummary' | translate">
<ion-icon name="fas-info-circle" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<!-- Add an empty context menu so tab pages can add items, otherwise the menu disappears in some cases. -->
<core-context-menu></core-context-menu>
</ion-buttons>
</ion-toolbar>
</ion-header>