Add + to toggle full screen
This commit is contained in:
14
Architype.js
14
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<!--# include file="Editor.js" -->
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user