From a79dcd44757a8bf8cc71fa99b02849cf546706d4 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 18 Jul 2019 04:05:44 +0000 Subject: [PATCH] Add + to toggle full screen --- Architype.js | 14 ++++++++++++++ README.md | 1 + 2 files changed, 15 insertions(+) diff --git a/Architype.js b/Architype.js index 8fba368..9f35775 100644 --- a/Architype.js +++ b/Architype.js @@ -292,6 +292,12 @@ class Architype { e.stopPropagation(); e.preventDefault(); return; + + case '+': + this.toggleFullScreen(); + e.stopPropagation(); + e.preventDefault(); + return; } let elem = document.activeElement; @@ -339,6 +345,14 @@ class Architype { this.renderGeneration_ = this.serialized_.generation; render.postMessage(this.serialized_); } + + toggleFullScreen() { + if (document.fullscreenElement) { + document.exitFullscreen(); + } else { + this.container_.requestFullscreen(); + } + } } diff --git a/README.md b/README.md index e903af0..b4e1db0 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ considered a reasonable tradeoff. * `m` Select the next theme (light/dark) * `M` Select the previous theme (light/dark) * `?` Add a help section below the current line +* `+` Toggle fullscreen Note that it is possible to delete the help section with the normal delete command `d`.