1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[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

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(