Sidebar overlap on content Issue fix #251

Sidebar overlap on content Issue fix #251
pull/266/head
Shahana Farooqui 4 years ago
parent 4c43b4c4c3
commit fd9728f8c4

@ -9,8 +9,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/images/favicon/site.webmanifest">
<link rel="stylesheet" href="styles.76f25502eb3f17a51952.css"></head>
<link rel="stylesheet" href="styles.d9adf916f6c98d03fbc8.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.829d82b26d0492e8b1c6.js" defer></script><script src="polyfills-es5.37b2eeccc22c1df73ce7.js" nomodule defer></script><script src="polyfills.f1c3d2a0bcdfc4e93ca8.js" defer></script><script src="main.d792ca9464935a0f012b.js" defer></script></body>
<script src="runtime.829d82b26d0492e8b1c6.js" defer></script><script src="polyfills-es5.37b2eeccc22c1df73ce7.js" nomodule defer></script><script src="polyfills.f1c3d2a0bcdfc4e93ca8.js" defer></script><script src="main.5eccf633f2cb53a6b3b5.js" defer></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,10 +1,10 @@
<div fxLayout="column" id="rtl-container" class="rtl-container medium" [ngClass]="[settings.themeColor | lowercase, settings.themeMode | lowercase]">
<mat-toolbar fxLayout="row" fxLayoutAlign="space-between center" class="padding-gap-x bg-primary rtl-top-toolbar">
<div>
<button class="top-toolbar-icon" mat-icon-button (click)="sideNavToggle()">
<button class="top-toolbar-icon" mat-icon-button (click)="sideNavToggle()" [matTooltip]="flgSideNavOpened ? 'Hide Navigation Menu' : 'Show Navigation Menu'" [matTooltipDisabled]="smallScreen">
<mat-icon class="mr-5px">menu</mat-icon>
</button>
<button *ngIf="!smallScreen" mat-icon-button (click)="flgSidenavPinned = !flgSidenavPinned">
<button *ngIf="!smallScreen" mat-icon-button (click)="flgSidenavPinned = !flgSidenavPinned" [matTooltip]="flgSidenavPinned ? 'Unpin Navigation Menu' : 'Pin Navigation Menu'">
<svg class="top-toolbar-icon icon-pinned" viewBox="0 0 32 32">
<path fill="currentColor" *ngIf="!flgSidenavPinned" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" />
<path fill="currentColor" *ngIf="flgSidenavPinned" d="M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z" />
@ -20,10 +20,10 @@
</div>
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav perfectScrollbar [opened]="true" [mode]="(flgSidenavPinned && !smallScreen) ? 'side' : 'over'" #sideNavigation class="sidenav mat-elevation-z6">
<mat-sidenav perfectScrollbar [opened]="flgSideNavOpened" [mode]="(flgSidenavPinned && !smallScreen) ? 'side' : 'over'" #sideNavigation class="sidenav mat-elevation-z6">
<rtl-side-navigation (ChildNavClicked)="onNavigationClicked($event)" fxFlex="100"></rtl-side-navigation>
</mat-sidenav>
<mat-sidenav-content perfectScrollbar>
<mat-sidenav-content perfectScrollbar #sideNavContent>
<div [ngClass]="{'mt-minus-1': smallScreen, 'inner-sidenav-content': true}">
<router-outlet></router-outlet>
</div>

@ -1,4 +1,4 @@
import { Component, OnInit, AfterViewInit, OnDestroy, ViewChild } from '@angular/core';
import { Component, OnInit, AfterViewInit, OnDestroy, ViewChild, Renderer2 } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
import { Subject } from 'rxjs';
@ -25,10 +25,12 @@ import * as fromRTLReducer from './store/rtl.reducers';
})
export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('sideNavigation', { static: false }) sideNavigation: any;
@ViewChild('sideNavContent', { static: false }) sideNavContent: any;
public selNode: ConfigSettingsNode;
public settings: Settings;
public information: GetInfoRoot = {};
public flgLoading: Array<Boolean | 'error'> = [true]; // 0: Info
public flgSideNavOpened = true;
public flgCopied = false;
public appConfig: RTLConfiguration;
public accessKey = '';
@ -38,7 +40,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private commonService: CommonService, private store: Store<fromRTLReducer.RTLState>, private actions$: Actions,
private userIdle: UserIdleService, private router: Router, private sessionService: SessionService, private breakpointObserver: BreakpointObserver) {}
private userIdle: UserIdleService, private router: Router, private sessionService: SessionService, private breakpointObserver: BreakpointObserver, private renderer: Renderer2) {}
ngOnInit() {
this.router.events.subscribe((evt) => {
@ -93,10 +95,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.router.navigate([this.appConfig.sso.logoutRedirectLink]);
}
}
// START: Workaround to add adjust container width initially
this.sideNavigation.toggle();
setTimeout(() => { this.sideNavigation.toggle(); }, 500);
// END: Workaround to add left margin to container initially
}
});
this.userIdle.startWatching();
@ -113,15 +111,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.userIdle.resetTimer();
}
});
this.commonService.containerWidthChanged.pipe(takeUntil(this.unSubs[4]))
.subscribe((fieldType: string) => {
if(fieldType !== 'menuType') {
this.sideNavToggle();
} else {
this.sideNavigation.toggle(); // To dynamically update the width to 100% after side nav is closed
setTimeout(() => { this.sideNavigation.toggle(); }, 0);
}
});
}
private readAccessKey() {
@ -132,10 +121,15 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
ngAfterViewInit() {
if (this.smallScreen) {
this.sideNavigation.close();
} else {
setTimeout(() => {
this.renderer.setStyle(this.sideNavContent.elementRef.nativeElement, 'marginLeft', '22rem'); //$regular-sidenav-width
}, 100);
}
}
sideNavToggle() {
this.flgSideNavOpened = !this.flgSideNavOpened;
this.sideNavigation.toggle();
}

@ -10,7 +10,6 @@ import { environment } from '../../../environments/environment';
export class CommonService implements OnInit, OnDestroy {
currencyUnits = [];
CurrencyUnitEnum = CurrencyUnitEnum;
containerWidthChanged = new Subject<string>();
conversionData = { data: null, last_fetched: null };
private screenSize = ScreenSizeEnum.MD;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
@ -45,10 +44,6 @@ export class CommonService implements OnInit, OnDestroy {
return str.charAt(0).toUpperCase() + str.substring(1).toLowerCase();
}
changeContainerWidth(fieldType: string) {
this.containerWidthChanged.next(fieldType);
}
convertCurrency(value: number, from: string, otherCurrencyUnit: string, fiatConversion: boolean): Observable<any> {
let latest_date = new Date().valueOf();
if(fiatConversion && otherCurrencyUnit) {
@ -187,8 +182,6 @@ export class CommonService implements OnInit, OnDestroy {
};
ngOnDestroy() {
this.containerWidthChanged.next();
this.containerWidthChanged.complete();
this.unSubs.forEach(completeSub => {
completeSub.next();
completeSub.complete();

@ -9,7 +9,7 @@ $horizontal-toolbar-height: 60px;
$font-family: 'Roboto', sans-serif;
$font-size: 1.4rem;
$toolbar-height: 48px;
$regular-sidenav-width: 220px;
$regular-sidenav-width: 22rem;
$compact-sidenav-width: 200px;
$mini-sidenav-width: 100px;
$sidenav-info-height: 90px;

Loading…
Cancel
Save