mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +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
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {Directive, ElementRef, Input, OnDestroy, OnInit, Renderer2} from '@angular/core';
|
import {Directive, ElementRef, Input, OnDestroy, OnInit, Renderer2} from '@angular/core';
|
||||||
import {AnimationController, NavController} from '@ionic/angular';
|
import {AnimationController, NavController} from '@ionic/angular';
|
||||||
import {Router, RouterEvent} from '@angular/router';
|
import {Router, RouterEvent} from '@angular/router';
|
||||||
@@ -46,6 +45,12 @@ export class RootLinkDirective implements OnInit, OnDestroy {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const animation = tabsTransition(this.animationController);
|
const animation = tabsTransition(this.animationController);
|
||||||
this.renderer.setAttribute(this.element.nativeElement, 'button', '');
|
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.subscriptions.push(
|
||||||
this.router.events.subscribe(event => {
|
this.router.events.subscribe(event => {
|
||||||
|
|||||||
Reference in New Issue
Block a user