Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/src/views/Shop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export default {
openModal(product) {
this.product = product
this.modalOpen = true
document.addEventListener('keydown', this.handleEscKey)
},
closeModal() {
this.product = null
Expand All @@ -246,6 +247,12 @@ export default {
this.purchaseSuccess = false
this.code = null
this.purchaseMode = 'myself'
document.removeEventListener('keydown', this.handleEscKey)
},
handleEscKey(event) {
if (event.key === 'Escape' && this.modalOpen) {
this.closeModal()
}
},
async purchase() {
this.loading = true
Expand Down
Loading