Skip to content

Commit

Permalink
Revert "Add toggle-fullscreen control with temp icons."
Browse files Browse the repository at this point in the history
This reverts commit 148605b.
  • Loading branch information
fabiocaccamo committed Aug 30, 2023
1 parent 148605b commit 3c7984f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 85 deletions.
11 changes: 0 additions & 11 deletions src/fontra/client/images/fullscreen-enter.svg

This file was deleted.

11 changes: 0 additions & 11 deletions src/fontra/client/images/fullscreen-exit.svg

This file was deleted.

4 changes: 0 additions & 4 deletions src/fontra/views/editor/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ body {
transform: scale(1.1, 1.1);
}

.tool-icon--hidden {
display: none;
}

.tool-button:hover {
background-color: var(--editor-tool-button-hover-background-color);
}
Expand Down
10 changes: 0 additions & 10 deletions src/fontra/views/editor/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@
<div class="tool-button" data-tool="zoom-fit-selection">
<inline-svg class="tool-icon" src="/images/bullseye.svg"></inline-svg>
</div>
<div class="tool-button" data-tool="toggle-fullscreen">
<inline-svg
class="tool-icon tool-icon--fullscreen-enter tool-icon--hidden"
src="/images/fullscreen-enter.svg"
></inline-svg>
<inline-svg
class="tool-icon tool-icon--fullscreen-exit tool-icon--hidden"
src="/images/fullscreen-exit.svg"
></inline-svg>
</div>
</div>
</div>
</div>
Expand Down
49 changes: 0 additions & 49 deletions src/fontra/views/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,10 @@ export class EditorController {
case "zoom-fit-selection":
this.zoomFit();
break;
case "toggle-fullscreen":
this.toggleFullscreen();
break;
}
this.canvasController.canvas.focus();
};
}

// init fullscreen button
this.updateFullscreenButton();
document.addEventListener("fullscreenchange", () => {
this.updateFullscreenButton();
});
}

addEditTool(tool) {
Expand Down Expand Up @@ -1583,46 +1574,6 @@ export class EditorController {
this.sceneController.autoViewBox = false;
}

toggleFullscreen() {
if (document.fullscreenElement) {
if (document.exitFullscreen) {
document.exitFullscreen();
}
} else {
const element = document.documentElement;
if (element.requestFullscreen) {
element.requestFullscreen();
}
}
}

updateFullscreenButton() {
// hide button in case fullscreen is not enabled on device
const fullscreenButtonEl = document.querySelector(
".tool-button[data-tool='toggle-fullscreen']"
);
if (!document.fullscreenEnabled) {
fullscreenButtonEl.style.display = "none";
return;
}
// fullscreen is enabled, show the right icon depending on the fullscreen state
const fullscreenEnterIconEl = fullscreenButtonEl.querySelector(
".tool-icon--fullscreen-enter"
);
const fullscreenExitIconEl = fullscreenButtonEl.querySelector(
".tool-icon--fullscreen-exit"
);
if (document.fullscreenElement) {
// fullscreen state is on, display exit-fullscreen button icon
fullscreenEnterIconEl.classList.add("tool-icon--hidden");
fullscreenExitIconEl.classList.remove("tool-icon--hidden");
} else {
// fullscreen state is off, display enter-fullscreen button icon
fullscreenEnterIconEl.classList.remove("tool-icon--hidden");
fullscreenExitIconEl.classList.add("tool-icon--hidden");
}
}

animateToViewBox(viewBox) {
const startViewBox = this.sceneSettings.viewBox;
const deltaViewBox = subItemwise(viewBox, startViewBox);
Expand Down

0 comments on commit 3c7984f

Please sign in to comment.