-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2단계 - 상세 정보 & UI/UX 개선하기] 초코(강다빈) 미션 제출합니다. #171
Changes from 1 commit
58a3ce0
5661a8a
022dbf2
f3135ea
52f9c3a
553471b
a9e23b3
a12194e
40846a2
00f7a69
dab4109
c67458d
716b456
4e07ad5
5057566
2bbc6f4
da29495
f74a933
0b51801
568b3c4
e2b5ccc
5622b4c
0696960
04750f0
1ca0616
97c0763
98ee73b
22dc6ad
b09291f
3755207
8cf6096
fa81b18
6d4fef8
4273068
a817135
a96aac3
11532ab
02db706
75004f9
28af29a
88c2cc7
acda9b6
b27638f
ea1b8a3
7b4d067
2094ff8
83c4cd4
24db597
9cb0f27
e2f6ecd
5399034
64dd479
065f2c6
a6111ca
cefc87f
f109faa
2cc746c
1b4ea09
0fbc146
1c2c72e
af8d8e8
b1e8768
28af320
5569bdb
ccb81ff
afa3b94
0148e13
7207d52
5fb1acf
73a10cf
2d77149
c1a406b
46943e3
15111d6
2dc4077
779cebb
485910f
7e3748e
de041e3
dc31890
8209206
1c9ff19
6c861dd
4eaa732
6707341
b64fdfc
6864ff6
4dac6b6
0330025
973037a
9709602
a1a8443
9858971
8cc5075
06cad8e
48726d8
5cdec22
4e169ca
bff9d97
c846053
4542fb2
722cb70
2fadb45
cb164ab
fa80a28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,8 @@ export default class Modal { | |
this.#updateVoteText(voteForMovie); | ||
} | ||
|
||
document.addEventListener('keydown', this.#handleKeyDown); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 웹 페이지에서 키보드 이벤트를 처리하기 위해 사용되는 이벤트
|
||
|
||
this.#isOpen = true; | ||
} | ||
|
||
|
@@ -142,9 +144,21 @@ export default class Modal { | |
myVoteDescription.textContent = VOTE[voteForMovie]; | ||
} | ||
|
||
#handleKeyDown = (event: KeyboardEvent) => { | ||
if (event.key === 'Escape') { | ||
this.closeModal(); | ||
} | ||
Comment on lines
+80
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아주 좋네요 ㅎㅎ 👍 👍 👍 |
||
}; | ||
|
||
removeKeydownEventListener() { | ||
document.removeEventListener('keydown', this.#handleKeyDown); | ||
} | ||
|
||
closeModal() { | ||
if (!this.#isOpen) return; | ||
|
||
this.removeKeydownEventListener(); | ||
|
||
if (this.#modalElement) { | ||
this.#modalElement.remove(); | ||
this.#modalElement = null; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이제 잘 보이네요 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미지 닫는 태그가 소스에 딱 붙어있어서 그랬더라구요