diff options
author | benal01 <bja4245@rit.edu> | 2025-03-22 12:14:00 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-03-22 12:14:00 -0400 |
commit | e9564ba2514f32c63d2ce4ecfc9eeb9f3269f3dd (patch) | |
tree | b6a3d6421bf1f8526632baec6acf20f1cb5e0d1a /ufund-ui/src/app/components/cupboard/cupboard.component.ts | |
parent | 2abd4b4ba9171821ac545f8dcb67be1e7d722e01 (diff) | |
download | JellySolutions-e9564ba2514f32c63d2ce4ecfc9eeb9f3269f3dd.tar.gz JellySolutions-e9564ba2514f32c63d2ce4ecfc9eeb9f3269f3dd.tar.bz2 JellySolutions-e9564ba2514f32c63d2ce4ecfc9eeb9f3269f3dd.zip |
[ngClass] tab styling
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index f8023c3..646c4ff 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -16,7 +16,7 @@ import { NeedListComponent } from '../need-list/need-list.component'; export class CupboardComponent implements OnInit { protected statusText = new BehaviorSubject("") - + selectedForm = "create" needs: any; @ViewChild("needList") needList?: NeedListComponent @@ -24,9 +24,6 @@ export class CupboardComponent implements OnInit { ngOnInit(): void { this.cupboardService.getNeeds().subscribe(n => this.needs = n); - this.close(); - this.openmenu(); - if (this.isManager()) { console.log("Admin view of Cupboard"); } else { @@ -41,44 +38,9 @@ export class CupboardComponent implements OnInit { type: '' }; selectedNeedId: number | null = null; - - private hideElement(element: any) { - if (element) { - element.style.visibility = 'hidden'; - element.style.position = 'absolute'; - } - } - - private showElement(element: any) { - if (element) { - element.style.visibility = 'visible'; - element.style.position = 'relative'; - } - } - openmenu() { - const menuElement = document.getElementById('menu'); - this.showElement(menuElement); - } - - opencreate() { - this.close(); - this.showElement(document.getElementById('create-form')); - } - - openupdate() { - this.close(); - this.showElement(document.getElementById('update-form')); - } - - back() { - this.close(); - this.openmenu(); - } - - close() { - this.hideElement(document.getElementById('create-form')); - this.hideElement(document.getElementById('destroy-form')); - this.hideElement(document.getElementById('update-form')); + + selectForm(name: string) { + this.selectedForm = name; } populateForm(need: any): void { |