MOBILE-2903 menu: Disable responsive menu items is set on site
parent
809753aac1
commit
12d75f14b2
|
@ -1,5 +1,5 @@
|
||||||
<div class="tabbar" role="tablist" #tabbar [hidden]="hidden">
|
<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 class="tab-highlight"></div>
|
||||||
<div *ngIf="_loaded === false" class="core-ion-tabs-loading">
|
<div *ngIf="_loaded === false" class="core-ion-tabs-loading">
|
||||||
<span class="core-ion-tabs-loading-spinner">
|
<span class="core-ion-tabs-loading-spinner">
|
||||||
|
|
|
@ -170,7 +170,7 @@ export class CoreMainMenuProvider {
|
||||||
* @return {number} Number of items depending on the device width.
|
* @return {number} Number of items depending on the device width.
|
||||||
*/
|
*/
|
||||||
getNumItems(): number {
|
getNumItems(): number {
|
||||||
if (window && window.innerWidth) {
|
if (!this.isResponsiveMainMenuItemsDisabledInCurrentSite() && window && window.innerWidth) {
|
||||||
let numElements;
|
let numElements;
|
||||||
|
|
||||||
if (this.tablet) {
|
if (this.tablet) {
|
||||||
|
@ -207,4 +207,15 @@ export class CoreMainMenuProvider {
|
||||||
|
|
||||||
return tablet ? 'side' : 'bottom';
|
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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue