summaryrefslogtreecommitdiffstats
path: root/web/react/components/view_image.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-19 10:25:51 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-19 10:25:51 -0700
commit468f01dc895000211e62eb8a16feaa84ceb354ed (patch)
tree4868b46316bb79cf5c127f5b0638f3383a7c971c /web/react/components/view_image.jsx
parenta8f3f76c592928a0907fbaddd71ab6b8f68d28d6 (diff)
parentea1b3129688dd76c80c7d41eec4f2eb60f9f0639 (diff)
downloadchat-468f01dc895000211e62eb8a16feaa84ceb354ed.tar.gz
chat-468f01dc895000211e62eb8a16feaa84ceb354ed.tar.bz2
chat-468f01dc895000211e62eb8a16feaa84ceb354ed.zip
Merging from master
Diffstat (limited to 'web/react/components/view_image.jsx')
-rw-r--r--web/react/components/view_image.jsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index f75693470..322e68c17 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -6,6 +6,7 @@ const Utils = require('../utils/utils.jsx');
const Constants = require('../utils/constants.jsx');
const ViewImagePopoverBar = require('./view_image_popover_bar.jsx');
const Modal = ReactBootstrap.Modal;
+const KeyCodes = Constants.KeyCodes;
export default class ViewImageModal extends React.Component {
constructor(props) {
@@ -63,11 +64,11 @@ export default class ViewImageModal extends React.Component {
this.loadImage(id);
}
handleKeyPress(e) {
- if (!e) {
+ if (!e || !this.props.show) {
return;
- } else if (e.keyCode === 39) {
+ } else if (e.keyCode === KeyCodes.RIGHT) {
this.handleNext();
- } else if (e.keyCode === 37) {
+ } else if (e.keyCode === KeyCodes.LEFT) {
this.handlePrev();
}
}