1
0
Fork 0

[client] Stop the page from moving round when you use the arrow keys

This commit is contained in:
Starbeamrainbowlabs 2017-07-30 22:23:19 +01:00
parent a0605c281d
commit 03181dc54a
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,13 @@ class BoardWindow extends EventEmitter
this.keyboard.on("keyup-c", (function(event) {
this.chunkCache.showRenderedChunks = !this.chunkCache.showRenderedChunks;
}).bind(this));
// Stop the document from scrolling around on some devices
document.addEventListener("keyup", function(event) {
if(event.keyCode >= 37 && event.keyCode <= 40) {
event.preventDefault();
return false;
}
})
// Grab a reference to the sidebar and wrap it in an Interface class instance
this.interface = new Interface(