mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 03:32:52 +00:00
fix: workaround for side menu items not being active on page load
This commit is contained in:
committed by
Rainer Killinger
parent
2220ab24b3
commit
947cab458c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 StApps
|
||||
* Copyright (C) 2023 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
@@ -12,7 +12,6 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Directive, ElementRef, Input, OnDestroy, OnInit, Renderer2} from '@angular/core';
|
||||
import {AnimationController, NavController} from '@ionic/angular';
|
||||
import {Router, RouterEvent} from '@angular/router';
|
||||
@@ -46,6 +45,12 @@ export class RootLinkDirective implements OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
const animation = tabsTransition(this.animationController);
|
||||
this.renderer.setAttribute(this.element.nativeElement, 'button', '');
|
||||
if (document.querySelector('#main')?.childNodes.length === 1) {
|
||||
if (this.router.url === this.rootLink) {
|
||||
this.setActive();
|
||||
}
|
||||
this.needsInit = false;
|
||||
}
|
||||
|
||||
this.subscriptions.push(
|
||||
this.router.events.subscribe(event => {
|
||||
|
||||
Reference in New Issue
Block a user