Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can use .preventDevault to prevent window from scrolling when arrow keys are down. - > https://drive.google.com/open?id=0BxbIDtQqSCoCdk5VS0VQMkQxYXM
I see that in "keydown" event you use key codes to detect arrow keys - there is a more easy way with .key property of that event - https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
Moreover .keyCode is DEPRECATED! https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode !
I think it will be a good pratcice to group code in main.js in sections like:
Also i think is a good pratcice to pas dependencies into functions by arguments not directly form global scope (line 1 and 278 of main.js).
Be careful with Object.create because it don't copy the object! It set the prototype to the old oobject so modyfications on old object have impact on new object. If you want check Object.assign https://developer.mozilla.org/pl/docs/Web/JavaScript/Referencje/Obiekty/Object/assign