diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-24 12:39:36 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-24 12:39:36 -0400 |
commit | 7efacb09bfb9dbd6b4c8dbca59c76e60c88d0e53 (patch) | |
tree | bbc77bc026ff48fa5900076f0ad201379711b638 /web/react/components/view_image.jsx | |
parent | 6c0d094d13e73346234bd5ca52b21323893cbbe5 (diff) | |
download | chat-7efacb09bfb9dbd6b4c8dbca59c76e60c88d0e53.tar.gz chat-7efacb09bfb9dbd6b4c8dbca59c76e60c88d0e53.tar.bz2 chat-7efacb09bfb9dbd6b4c8dbca59c76e60c88d0e53.zip |
Fixing arrow keys in preview image modal
Diffstat (limited to 'web/react/components/view_image.jsx')
-rw-r--r-- | web/react/components/view_image.jsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 8db63e196..e645878c1 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -40,7 +40,9 @@ export default class ViewImageModal extends React.Component { }; } handleNext(e) { - e.stopPropagation(); + if (e) { + e.stopPropagation(); + } var id = this.state.imgId + 1; if (id > this.props.filenames.length - 1) { id = 0; @@ -49,7 +51,9 @@ export default class ViewImageModal extends React.Component { this.loadImage(id); } handlePrev(e) { - e.stopPropagation(); + if (e) { + e.stopPropagation(); + } var id = this.state.imgId - 1; if (id < 0) { id = this.props.filenames.length - 1; |