Created
August 13, 2015 11:27
-
-
Save petrbrzek/995ab7077089ff63e9b6 to your computer and use it in GitHub Desktop.
React keymaps idea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = | |
ProjectManager: | |
PROJECT_MANAGER_MOVE_LEFT: | |
osx: | |
'left' | |
windows: | |
'left' | |
linux: | |
'left' | |
PROJECT_MANAGER_MOVE_RIGHT: | |
osx: | |
'right' | |
windows: | |
'right' | |
linux: | |
'right' | |
# In different file | |
module.exports = React.createClass | |
displayName: 'ProjectManager' | |
mixins: [KeymapsMixin(KeymapsStore)] | |
keymaps: (keymap) -> | |
switch keymap | |
when Keymap.PROJECT_MANAGER_MOVE_LEFT then _.partial(@_move, 'left') | |
when Keymap.PROJECT_MANAGER_MOVE_RIGHT then _.partial(@_move, 'right') | |
render: -> | |
div | |
className: loadingClassNames, | |
Progress | |
type: 'indefinite' | |
title: 'Loading project. Please wait.' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment