diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 16:46:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 16:46:55 +0200 |
commit | 2484c63d77e05fff384cc08b6ea46a29a22a62ec (patch) | |
tree | 21b8b74f1788407a4cfb13052160398f13424ac6 /recipes/googlecalendar | |
parent | Add check to ensure that generated file 'user.js' is not present in default p... (diff) | |
download | ferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.tar.gz ferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.tar.zst ferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.zip |
chore: repo maintenance (#732)
Diffstat (limited to 'recipes/googlecalendar')
-rw-r--r-- | recipes/googlecalendar/webview-unsafe.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/recipes/googlecalendar/webview-unsafe.js b/recipes/googlecalendar/webview-unsafe.js index c47f572..54a7338 100644 --- a/recipes/googlecalendar/webview-unsafe.js +++ b/recipes/googlecalendar/webview-unsafe.js | |||
@@ -26,7 +26,8 @@ const hideModal = () => { | |||
26 | const createModal = () => { | 26 | const createModal = () => { |
27 | const modalDialog = document.createElement('div'); | 27 | const modalDialog = document.createElement('div'); |
28 | modalDialog.setAttribute('id', 'franz-modal'); | 28 | modalDialog.setAttribute('id', 'franz-modal'); |
29 | modalDialog.innerHTML = '<div class="modal-content"><span class="close">×</span><p></p></div>'; | 29 | modalDialog.innerHTML = |
30 | '<div class="modal-content"><span class="close">×</span><p></p></div>'; | ||
30 | modalDialog.querySelector('.close').addEventListener('click', hideModal); | 31 | modalDialog.querySelector('.close').addEventListener('click', hideModal); |
31 | 32 | ||
32 | return modalDialog; | 33 | return modalDialog; |
@@ -35,5 +36,11 @@ const createModal = () => { | |||
35 | window.alert = showModal; | 36 | window.alert = showModal; |
36 | 37 | ||
37 | modal = createModal(); | 38 | modal = createModal(); |
38 | waitFor(() => document.body, () => document.body.appendChild(modal)); | 39 | waitFor( |
39 | document.addEventListener('keydown', event => event.keyCode === 27 && hideModal()); | 40 | () => document.body, |
41 | () => document.body.appendChild(modal), | ||
42 | ); | ||
43 | document.addEventListener( | ||
44 | 'keydown', | ||
45 | event => event.key === 'Escape' && hideModal(), | ||
46 | ); | ||