diff options
author | benal01 <bja4245@rit.edu> | 2025-03-25 10:43:52 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-03-25 10:43:52 -0400 |
commit | d9eb78521f29ead3a9f70b09e18a6d9560cc849c (patch) | |
tree | 50622f8c4d435a99d40bf7a30d473e763110f803 /ufund-ui/src/app/components/need-list/need-list.component.ts | |
parent | f7cd2d90191c1d81526ed549514d82864c1aebb2 (diff) | |
download | JellySolutions-d9eb78521f29ead3a9f70b09e18a6d9560cc849c.tar.gz JellySolutions-d9eb78521f29ead3a9f70b09e18a6d9560cc849c.tar.bz2 JellySolutions-d9eb78521f29ead3a9f70b09e18a6d9560cc849c.zip |
fancy selection animation for need list
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/need-list/need-list.component.ts | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index e47929b..9ef191a 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -112,6 +112,32 @@ export class NeedListComponent { } select(need : Need) { - this.selectedNeed = need; + if (this.selectedNeed) { + //revert already selected need to previous style + console.log(need.id); + let button = document.getElementById('need-button-' + this.selectedNeed.id); + if (button) { + console.log(button) + button.style.background = 'lightgray'; + button.style.marginLeft = '0%'; + button.style.width = '98%'; + } + button = document.getElementById('need-edit-button-' + this.selectedNeed.id); + if (button) { + button.style.visibility = 'visible'; + } + } + //change selected need to selected style + this.selectedNeed = need; + let button = document.getElementById('need-button-' + need.id); + if (button) { + button.style.background = 'white'; + button.style.marginLeft = '4%'; + button.style.width = '100%'; + } + button = document.getElementById('need-edit-button-' + need.id); + if (button) { + button.style.visibility = 'hidden'; + } } }
\ No newline at end of file |