Skip to content
Snippets Groups Projects
Commit c77a9af9 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Added better fullscreen button with toggle ability.

parent cf2caaa3
No related branches found
No related tags found
No related merge requests found
......@@ -291,22 +291,21 @@ function loadComponents() {
function createFullScreenButton() {
const sceneNode = document.getElementById('3d-graph');
const overlayNode = document.createElement('button');
overlayNode.className = 'fullscreen_button';
overlayNode.innerText = 'fullscreen';
const sceneNode = getCanvasDivNode();
const overlayNode = document.createElement('div');
overlayNode.className = 'fullscreen-button';
overlayNode.innerHTML = '<p>&#10530;</p>';
overlayNode.addEventListener("click", function () {
if(getCanvasDivNode().requestFullscreen) {
getCanvasDivNode().requestFullscreen().then(
() => G.resize()
);
if (!document.fullscreenElement) {
getCanvasDivNode().requestFullscreen();
} else {
document.exitFullscreen();
}
G.resize();
});
sceneNode.appendChild(overlayNode);
}
const dataUrl = plugin_path + 'datasets/aud1.json'
G = new Graph(dataUrl);
linkoverlay = new LinkOverlay(G);
......
......@@ -53,6 +53,16 @@
font-size: 20px;
}
.fullscreen-button {
pointer-events: all;
z-index: 99;
cursor: pointer;
left: 15px;
top: 5px;
position: absolute;
font-size: 30px;
}
.detail-view {
position: absolute;
top: 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment