diff options
author | Asaad Mahmood <Unknowngi@live.com> | 2015-10-19 22:59:01 +0500 |
---|---|---|
committer | Asaad Mahmood <Unknowngi@live.com> | 2015-10-19 22:59:01 +0500 |
commit | 5135986a3b13c0a4474dbbca683d89ffbc1dead5 (patch) | |
tree | 42e511c01a0e707356091fd4d09911eb18b8ca20 /web/react/components/view_image.jsx | |
parent | 2d42aefeafd2a0bea6419a6ef79c0c9b1fd313eb (diff) | |
parent | fd69910fab332642a7793e64064169e89eb0c3de (diff) | |
download | chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.tar.gz chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.tar.bz2 chat-5135986a3b13c0a4474dbbca683d89ffbc1dead5.zip |
Merge branch 'master' of https://github.com/mattermost/platform into ui-improvements
Diffstat (limited to 'web/react/components/view_image.jsx')
-rw-r--r-- | web/react/components/view_image.jsx | 7 |
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(); } } |