MOBILE-2903 menu: Disable responsive menu items is set on site

main
Pau Ferrer Ocaña 2019-05-02 11:59:22 +02:00
parent 809753aac1
commit 12d75f14b2
2 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div class="tabbar" role="tablist" #tabbar [hidden]="hidden">
<a [hidden]="_loaded === false" *ngFor="let t of _tabs" [tab]="t" class="tab-button" role="tab" href="#" (ionSelect)="select(t)" [attr.aria-hidden]="!t.show" [attr.aria-label]="t.tabTitle || ''"></a>
<a [hidden]="_loaded === false" *ngFor="let t of _tabs" [tab]="t" class="tab-button" role="tab" href="#" (ionSelect)="select(t)" [attr.aria-hidden]="!t.show" [attr.aria-label]="t.tabTitle || ''" [title]="t.tabTitle || ''"></a>
<div class="tab-highlight"></div>
<div *ngIf="_loaded === false" class="core-ion-tabs-loading">
<span class="core-ion-tabs-loading-spinner">

View File

@ -170,7 +170,7 @@ export class CoreMainMenuProvider {
* @return {number} Number of items depending on the device width.
*/
getNumItems(): number {
if (window && window.innerWidth) {
if (!this.isResponsiveMainMenuItemsDisabledInCurrentSite() && window && window.innerWidth) {
let numElements;
if (this.tablet) {
@ -207,4 +207,15 @@ export class CoreMainMenuProvider {
return tablet ? 'side' : 'bottom';
}
/**
* Check if responsive main menu items is disabled in the current site.
*
* @return {boolean} Whether it's disabled.
*/
protected isResponsiveMainMenuItemsDisabledInCurrentSite(): boolean {
const site = this.sitesProvider.getCurrentSite();
return site && site.isFeatureDisabled('NoDelegate_ResponsiveMainMenuItems');
}
}