Skip to content

Commit

Permalink
Implemented refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPienaar committed Sep 24, 2023
1 parent af65dcc commit f3b74a0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion frontend/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@
[ngClass]="{'hover': this.folderIDHistory[this.folderIDHistoryPosition] !== ''}"
title="To Enclosing Folder" />
</div>
<div class="imgWrapper" (click)="$event.stopPropagation()">
<img class="refreshIcon hover" src="assets/Icons/editIcons/refresh.svg" alt="" (click)="ngOnInit()"
title="Refresh Directory" />
</div>

<!-- <div class="searchBar" (click)="$event.stopPropagation()">
<img alt="searchIcon" src="assets/Icons/homeIcons/mainWindow/searchIcon.png" />
<input (input)="filterTable($event, 0)" class="search-input" placeholder="Search..." type="text" />
</div> -->
</div>
</div>
<div class="folderNameWrapper">


Expand Down
7 changes: 7 additions & 0 deletions frontend/src/app/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ textarea {
border-radius: 5px;
}

.refreshIcon{
width: 42px;
height: 42px;
padding: 10px;
border-radius: 5px;
}

.iconSpacing .hover:hover {
cursor: pointer;
background-color: darken($light-grey, 10%);
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
}

async ngOnInit() {
this.loading = true;
// Get a reference to the menubar element with the specific class
this.menubarElement = this.elementRef.nativeElement.querySelector(
'.p-menubar.custom-menubar'
Expand All @@ -341,7 +342,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
this.updateMenubarWidth();
// Below is the function that initially populates the fileTree

this.nodeService.getFilesAndFolders().then(() => {
await this.nodeService.getFilesAndFolders().then(() => {
const hist = localStorage.getItem('folderIDHistory');
const pos = localStorage.getItem('folderIDHistoryPosition');

Expand Down Expand Up @@ -419,6 +420,8 @@ export class HomeComponent implements OnInit, AfterViewInit {
this.rootFolder.Selected = false;
this.rootFolder.MoveSelected = false;
this.rootFolder.Type = 'folder';

this.loading = false;
}

iterateNodeIDRemoval(node: any[]) {
Expand Down Expand Up @@ -1843,5 +1846,6 @@ export class HomeComponent implements OnInit, AfterViewInit {
this.contextMenu.position(event);
this.contextMenu.show(event);
}

protected readonly focus = focus;
}

0 comments on commit f3b74a0

Please sign in to comment.