Add + to toggle full screen

This commit is contained in:
Ian Gulliver
2019-07-18 04:05:44 +00:00
parent c9cc43126d
commit a79dcd4475
2 changed files with 15 additions and 0 deletions

View File

@@ -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" -->