aboutsummaryrefslogtreecommitdiff
path: root/p/scripts/main.js
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2021-11-14 23:24:47 +0100
committerGravatar GitHub <noreply@github.com> 2021-11-14 23:24:47 +0100
commitf12637d2b267be942fe03030f1e8946e2b480185 (patch)
tree05179d1c730ec618f00a8ef7f0bfa6b22926b382 /p/scripts/main.js
parente61906b5e78e8dba6fef59ae00f6f2e100ab2ed7 (diff)
Fix js errors (#3980)
* fixed missed popup * fix missed document.getElementById('loginButton') * make fix-all Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'p/scripts/main.js')
-rw-r--r--p/scripts/main.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index faf8650fd..0a828f04c 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1392,23 +1392,24 @@ function closePopup() {
function init_popup() {
// Fetch elements.
popup = document.getElementById('popup');
+ if (popup) {
+ popup_iframe_container = document.getElementById('popup-iframe-container');
+ popup_iframe = document.getElementById('popup-iframe');
- popup_iframe_container = document.getElementById('popup-iframe-container');
- popup_iframe = document.getElementById('popup-iframe');
+ popup_txt = document.getElementById('popup-txt');
- popup_txt = document.getElementById('popup-txt');
-
- // Configure close button.
- document.getElementById('popup-close').addEventListener('click', function (ev) {
- closePopup();
- });
-
- // Configure close-on-click.
- window.addEventListener('click', function (ev) {
- if (ev.target == popup) {
+ // Configure close button.
+ document.getElementById('popup-close').addEventListener('click', function (ev) {
closePopup();
- }
- });
+ });
+
+ // Configure close-on-click.
+ window.addEventListener('click', function (ev) {
+ if (ev.target == popup) {
+ closePopup();
+ }
+ });
+ }
}
// </popup>