Skip to content

Commit

Permalink
fix search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
tsolakoua committed Dec 22, 2023
1 parent 2048727 commit 22e5309
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,3 @@
}
</script>
{% endblock %}

{% block scripts %}
<script>
// Event listener for link clicks
window.addEventListener('DOMContentLoaded', (event) => {
document.body.addEventListener('click', function (event) {
var target = event.target;

if (target.tagName === 'A') {
var href = target.getAttribute('href');

// Check if the link is external and matches the specified domain
if (href.includes('developers.amadeus.com') && window.location.hostname === 'amadeus4dev.github.io') {
event.preventDefault();

// Modify the redirect URL
const redirectUrl = 'https://developers.amadeus.com/self-service/apis-docs/guides' + href.split('developers.amadeus.com')[1];

// Redirect to the modified URL
window.location.href = redirectUrl;
}
}
});
});
</script>
{% endblock %}

0 comments on commit 22e5309

Please sign in to comment.