Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85650309
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
762 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js
index 36cd7f4a37..963f4bcd94 100644
--- a/src/components/modal/modal.js
+++ b/src/components/modal/modal.js
@@ -1,17 +1,21 @@
const Modal = {
props: ['show', 'title'],
methods: {
close: function () {
this.$emit('close')
- }
- },
- mounted: function () {
- document.addEventListener('keydown', (e) => {
+ },
+ handleKeydown: function (e) {
if (this.show && e.keyCode === 27) {
this.close()
}
- })
+ }
+ },
+ mounted: function () {
+ document.addEventListener('keydown', this.handleKeydown)
+ },
+ destroyed: function () {
+ document.removeEventListener('keydown', this.handleKeydown)
}
}
export default Modal
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 30, 12:10 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1737631
Default Alt Text
(762 B)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment