Add design update to the aside from header component.

This commit is contained in:
2019-02-10 15:13:15 +01:00
parent 5e332dcca3
commit 284580c2ce
3 changed files with 49 additions and 42 deletions

View File

@@ -48,7 +48,7 @@
</a> </a>
<div *ngFor="let category of listCategories"> <div *ngFor="let category of listCategories">
<a [id]="'category-' + category.id" class="collapsible" *ngIf="category.listSubCategories.length" (click)="openCategoriesLinks(category)"> <a [id]="'category-' + category.id" class="collapsible" *ngIf="category.listSubCategories.length" (click)="openCategoriesLinks(category)">
{{category.name}} <i class="fa fa-chevron-down pull-right"></i> {{category.name}} <i class="fa {{accordionOpenned[category.id] ? 'fa-chevron-down' : 'fa-chevron-right'}} float-right"></i>
</a> </a>
<div class="categoriesLinks" > <div class="categoriesLinks" >
<a *ngFor="let subCategory of category.listSubCategories" <a *ngFor="let subCategory of category.listSubCategories"

View File

@@ -20,7 +20,7 @@
height: 100%; /* 100% Full-height */ height: 100%; /* 100% Full-height */
width: 0; /* 0 width - change this with JavaScript */ width: 0; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */ position: fixed; /* Stay in place */
z-index: 1000; /* Stay on top */ z-index: 1050; /* Stay on top */
top: 0; /* Stay at the top */ top: 0; /* Stay at the top */
left: 0; left: 0;
background-color: #3f51b5; background-color: #3f51b5;
@@ -89,3 +89,7 @@
.dropdown-item.danger-color-dark:hover { .dropdown-item.danger-color-dark:hover {
background-color: #ff4444 !important; background-color: #ff4444 !important;
} }
.collapsible i.fa {
padding-top: 4px;
}

View File

@@ -16,6 +16,7 @@ export class HeaderComponent implements OnInit {
isAdmin: boolean; isAdmin: boolean;
listCategories: Array<Category> = []; listCategories: Array<Category> = [];
title: string; title: string;
accordionOpenned: Array<Boolean> = [];
constructor( constructor(
private authService: AuthService, private authService: AuthService,
@@ -73,8 +74,10 @@ export class HeaderComponent implements OnInit {
const divContent = divCategoriesLinks.nextElementSibling as HTMLElement; const divContent = divCategoriesLinks.nextElementSibling as HTMLElement;
if (divContent.style.maxHeight) { if (divContent.style.maxHeight) {
divContent.style.maxHeight = null; divContent.style.maxHeight = null;
this.accordionOpenned[category.id] = false;
} else { } else {
divContent.style.maxHeight = divContent.scrollHeight + 'px'; divContent.style.maxHeight = divContent.scrollHeight + 'px';
this.accordionOpenned[category.id] = true;
} }
} }
} }