diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/view_image.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 4b2f8f650..dd3d98a8f 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -93,11 +93,22 @@ module.exports = React.createClass({ } ); + $(this.getDOMNode()).on('keyup', function(e) { + if(!e) { + return; + } else if (e.keyCode === 39) { + self.handleNext(); + } else if (e.keyCode === 37) { + self.handlePrev(); + } + }); + // keep track of whether or not this component is mounted so we can safely set the state asynchronously this.canSetState = true; }, componentWillUnmount: function() { this.canSetState = false; + $(this.getDOMNode()).off('keyup'); }, getPublicLink: function(e) { data = {}; |