From 05aea0454c5e88660482e00c222f0352e782b661 Mon Sep 17 00:00:00 2001 From: Anna Tsolakou Date: Mon, 18 Dec 2023 17:44:25 +0100 Subject: [PATCH] remove dom listener --- overrides/main.html | 48 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/overrides/main.html b/overrides/main.html index 47d591b7..5854b5a8 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -12,50 +12,24 @@ const redirectUrl = path.replace(redirectPattern, 'https://developers.amadeus.com/self-service/apis-docs/guides/$1'); document.write(``); } - - // Event listener for link clicks - window.addEventListener('DOMContentLoaded', (event) => { - document.body.addEventListener('click', function (event) { - var target = event.target; - console.log('we are in the second script'); - if (target.tagName === 'A') { - console.log('we are in the first if from second script'); - var href = target.getAttribute('href'); - if (href.startsWith('https://developers.amadeus.com')) { - console.log('we are in the second if from second script'); - event.preventDefault(); - window.location.href = href; - } - } - }); - }); {% endblock %} {% block scripts %} {% endblock %}