mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-09-10 03:37:11 +02:00
Added onclick functionality for menu items
This commit is contained in:
@@ -42,8 +42,11 @@ function exitFullscreen() {
|
||||
* Toggle between enter and exit fullscreen.
|
||||
*/
|
||||
function toggleFullscreen() {
|
||||
if (document.fullscreenElement) exitFullscreen();
|
||||
else enterFullscreen();
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const isFull = params.get('fullscreen') === '1';
|
||||
|
||||
if (isFull) exitFullscreen();
|
||||
else enterFullscreen();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -139,5 +139,20 @@ window.addEventListener('popstate', function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Opens the current iframe URL in a new browser tab.
|
||||
*/
|
||||
function openIframeInNewTab() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const iframeUrl = params.get('iframe');
|
||||
if (iframeUrl) {
|
||||
window.open(iframeUrl, '_blank');
|
||||
} else {
|
||||
alert('No iframe is currently open.');
|
||||
}
|
||||
}
|
||||
// expose globally so your template’s onclick can find it
|
||||
window.openIframeInNewTab = openIframeInNewTab;
|
||||
|
||||
// Adjust iframe height on window resize
|
||||
window.addEventListener('resize', syncIframeHeight);
|
||||
|
Reference in New Issue
Block a user