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

Added a tooltip to the fullscreen button.

parent b0fba4b2
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
user-select: none; user-select: none;
z-index: 1; z-index: 1;
pointer-events: none; pointer-events: none;
cursor: default;
} }
.no-select { .no-select {
...@@ -56,7 +57,6 @@ ...@@ -56,7 +57,6 @@
-ms-user-select: none; /* Internet Explorer/Edge */ -ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently user-select: none; /* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */ supported by Chrome, Edge, Opera and Firefox */
cursor: default;
} }
.close-button { .close-button {
......
...@@ -15,18 +15,19 @@ function loadComponents() { ...@@ -15,18 +15,19 @@ function loadComponents() {
function createFullScreenButton() { function createFullScreenButton() {
const sceneNode = Helpers.getCanvasDivNode(); const sceneNode = Helpers.getCanvasDivNode();
const overlayNode = document.createElement("div"); const overlayNode = Helpers.createDiv("fullscreen-button", sceneNode, {
overlayNode.className = "fullscreen-button"; innerHTML: "<p>&#10530;</p>",
overlayNode.innerHTML = "<p>&#10530;</p>"; title: "Vollbild",
});
overlayNode.classList.add("no-select");
overlayNode.addEventListener("click", function () { overlayNode.addEventListener("click", function () {
if (screenfull.isEnabled) { if (screenfull.isEnabled) {
screenfull.toggle(Helpers.getCanvasDivNode()); screenfull.toggle(sceneNode);
G.resize(); G.resize();
} else { } else {
console.log("No fullscreen mode available :("); console.log("No fullscreen mode available :(");
} }
}); });
sceneNode.appendChild(overlayNode);
} }
let G = null; let G = null;
......
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