Skip to content

Commit

Permalink
start menu button click event coming next
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Oct 1, 2024
1 parent e358b44 commit 8c7feca
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/app/system-apps/desktop/desktop.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<cos-menu [nestedMenu]="deskTopMenu" *ngIf="showDesktopCntxtMenu" [style]="dskTopCntxtMenuStyle" [menuType]="deskTopMenuOption"> </cos-menu>
<cos-taskbarpreview [fadeState]="tskBarPreviewWindowState" [name]="appToPreview" [icon]="appToPreviewIcon" *ngIf="showTskBarPreviewWindow" [ngStyle]="tskBarPrevWindowStyle"> </cos-taskbarpreview>
<cos-menu [generalMenu]="taskBarMenuData" *ngIf="showTskBarCntxtMenu" [style]="tskBarCntxtMenuStyle" [menuType]="tskBarMenuOption" [menuOrder]="menuOrder"> </cos-menu>
<!-- <cos-startmenu *ngIf="showStartMenu"></cos-startmenu> -->
<cos-startmenu ></cos-startmenu>
<cos-startmenu *ngIf="showStartMenu"></cos-startmenu>
<!-- <cos-startmenu ></cos-startmenu> -->
<ng-content> </ng-content>
</main>
12 changes: 6 additions & 6 deletions src/app/system-apps/fileexplorer/fileexplorer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
</ng-container>

<ng-template #iconsView>
<li class="li-icon-size-view" *ngFor="let file of files; let i = index" id="ilElmnt-{{this.processId}}" >
<li class="li-icon-size-view" *ngFor="let file of fileExplrFiles; let i = index" id="ilElmnt-{{this.processId}}" >

<button class="button-icon-size-view" tabindex="0" (dblclick)="runProcess(file)" (mouseenter)="onMouseEnter($event, file, i)" (mouseleave)="onMouseLeave(i)"
(contextmenu)="onShowIconContextMenu($event, file, i)" (click)="onBtnClick(i)" id="btnElmnt-{{this.processId}}-{{i}}">
Expand All @@ -304,7 +304,7 @@
</ng-template>

<ng-template #listView0>
<li class="li-list-view" *ngFor="let file of files; let i = index" id="ilElmnt-{{this.processId}}">
<li class="li-list-view" *ngFor="let file of fileExplrFiles; let i = index" id="ilElmnt-{{this.processId}}">
<button class="button-list-view" tabindex="0" (dblclick)="runProcess(file)" (mouseenter)="onMouseEnter($event, file, i)" (mouseleave)="onMouseLeave(i)"
(contextmenu)="onShowIconContextMenu($event, file, i)" (click)="onBtnClick(i)" id="btnElmnt-{{this.processId}}-{{i}}">

Expand All @@ -330,7 +330,7 @@
</ng-template>
<ng-template #contentView0>
<!-- adding (mouseenter)="onMouseEnter($event, file, i)" (mouseleave)="onMouseLeave(i)" id="btnElmnt-{{this.processId}}-{{i}}" to the li elements covers it completley on highlight-->
<li class="li-content-view" *ngFor="let file of files; let i = index">
<li class="li-content-view" *ngFor="let file of fileExplrFiles; let i = index">
<button class="button-content-view" tabindex="0" (dblclick)="runProcess(file)" (mouseenter)="onMouseEnter($event, file, i)" (mouseleave)="onMouseLeave(i)"
(contextmenu)="onShowIconContextMenu($event, file, i)" (click)="onBtnClick(i)" id="btnElmnt-{{this.processId}}-{{i}}">
<span class="span-content-view">
Expand Down Expand Up @@ -365,7 +365,7 @@
</li>
</ng-template>
<ng-template #tilesView0>
<li class="li-tiles-view" *ngFor="let file of files; let i = index">
<li class="li-tiles-view" *ngFor="let file of fileExplrFiles; let i = index">
<button class="button-tiles-view" tabindex="0" (dblclick)="runProcess(file)" (mouseenter)="onMouseEnter($event, file, i)" (mouseleave)="onMouseLeave(i)"
(contextmenu)="onShowIconContextMenu($event, file, i)" (click)="onBtnClick(i)" id="btnElmnt-{{this.processId}}-{{i}}">
<span class="span-tiles-view">
Expand Down Expand Up @@ -437,9 +437,9 @@
</div>
<div class="fileexp-footer-container" >
<span class="span-footer"> </span>
<span class="span-footer">{{files.length}} items</span>
<span class="span-footer">{{fileExplrFiles.length}} items</span>
<span class="span-footer">|</span>
<!-- <span class="span-footer">{{files.length - files.length}} items selected</span>
<!-- <span class="span-footer">{{fileExplrFiles.length - fileExplrFiles.length}} items selected</span>
<span class="span-footer">|</span> -->
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
ribbonMenuCntnrStyle:Record<string, unknown> = {};
olClassName = 'ol-icon-size-view';

files:FileInfo[] = [];
fileExplrFiles:FileInfo[] = [];
fileTreeNode:FileTreeNode[] = [];
_fileInfo!:FileInfo;
prevPathEntries:string[] = [];
Expand Down Expand Up @@ -432,7 +432,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
const iconIdx = icon_sizes.indexOf(iconSize);
const btnIdx = (iconIdx <= 2) ? 0 : 1;

for(let i = 0; i < this.files.length; i++){
for(let i = 0; i < this.fileExplrFiles.length; i++){
const btnElmnt = document.getElementById(`btnElmnt-${this.processId}-${i}`) as HTMLElement;
const imgElmnt = document.getElementById(`imgElmnt-${this.processId}-${i}`) as HTMLElement;

Expand Down Expand Up @@ -840,7 +840,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
}

private async loadFilesInfoAsync(showUrlFiles=true):Promise<void>{
this.files = [];
this.fileExplrFiles = [];
this._fileService.resetDirectoryFiles();
let directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory);

Expand All @@ -865,7 +865,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
const fileEntry = this._directoryFilesEntires[i];
const fileInfo = await this._fileService.getFileInfoAsync(fileEntry.getPath);

this.files.push(fileInfo)
this.fileExplrFiles.push(fileInfo)
}
}

Expand Down Expand Up @@ -1426,15 +1426,15 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn

sortIcons(sortBy:string): void {
if(sortBy === "Size"){
this.files = this.files.sort((objA, objB) => objB.getSize - objA.getSize);
this.fileExplrFiles = this.fileExplrFiles.sort((objA, objB) => objB.getSize - objA.getSize);
}else if(sortBy === "Date Modified"){
this.files = this.files.sort((objA, objB) => objB.getDateModified.getTime() - objA.getDateModified.getTime());
this.fileExplrFiles = this.fileExplrFiles.sort((objA, objB) => objB.getDateModified.getTime() - objA.getDateModified.getTime());
}else if(sortBy === "Name"){
this.files = this.files.sort((objA, objB) => {
this.fileExplrFiles = this.fileExplrFiles.sort((objA, objB) => {
return objA.getFileName < objB.getFileName ? -1 : 1;
});
}else if(sortBy === "Item Type"){
this.files = this.files.sort((objA, objB) => {
this.fileExplrFiles = this.fileExplrFiles.sort((objA, objB) => {
return objA.getFileType < objB.getFileType ? -1 : 1;
});
}
Expand Down Expand Up @@ -1797,10 +1797,10 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn

if(result){
// renamFileAsync, doesn't trigger a reload of the file directory, so to give the user the impression that the file has been updated, the code below
const fileIdx = this.files.findIndex(f => (f.getCurrentPath == this.selectedFile.getContentPath) && (f.getFileName == this.selectedFile.getFileName));
const fileIdx = this.fileExplrFiles.findIndex(f => (f.getCurrentPath == this.selectedFile.getContentPath) && (f.getFileName == this.selectedFile.getFileName));
this.selectedFile.setFileName = renameText;
this.selectedFile.setDateModified = Date.now();
this.files[fileIdx] = this.selectedFile;
this.fileExplrFiles[fileIdx] = this.selectedFile;

this.renameForm.reset();
await this.loadFilesInfoAsync();
Expand Down
6 changes: 3 additions & 3 deletions src/app/system-apps/startmenu/startmenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class StartMenuComponent implements OnInit, AfterViewInit {

setTimeout(async () => {
await this.loadFilesInfoAsync();
}, 1500);
}, 100);
//
this.removeVantaJSSideEffect();
}
Expand Down Expand Up @@ -80,7 +80,7 @@ export class StartMenuComponent implements OnInit, AfterViewInit {

// Allow the browser to calculate the layout before applying the animation
smIconTxtOverlay.style.transition = 'width 0.4s ease'; // Set the transition for left
smIconTxtOverlay.style.width = '248px'; // Animate to 250px
smIconTxtOverlay.style.width = '248px'; // Animate to 248px
smIconTxtOverlay.style.transitionDelay = '1s';
//smIconTxtOverlay.style.backgroundColor = 'rgba(33,33, 33, 0.6)';

Expand Down Expand Up @@ -108,7 +108,7 @@ export class StartMenuComponent implements OnInit, AfterViewInit {
this.txtOverlayMenuStyle = {
'display': 'none'
}
}, 300); // Set this to match the transition duration (1s)
}, 300); // Set this to match the transition duration (.3s)
}
}

Expand Down

0 comments on commit 8c7feca

Please sign in to comment.