summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-09-24 12:53:14 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-09-24 12:53:14 -0400
commit627e4f1c2bbb0fac77ac092549b0c88245eff972 (patch)
treebbc77bc026ff48fa5900076f0ad201379711b638 /web/react/components
parent6c0d094d13e73346234bd5ca52b21323893cbbe5 (diff)
parent7efacb09bfb9dbd6b4c8dbca59c76e60c88d0e53 (diff)
downloadchat-627e4f1c2bbb0fac77ac092549b0c88245eff972.tar.gz
chat-627e4f1c2bbb0fac77ac092549b0c88245eff972.tar.bz2
chat-627e4f1c2bbb0fac77ac092549b0c88245eff972.zip
Merge pull request #784 from mattermost/img-modal-fix
Fixing arrow keys in preview image modal
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/view_image.jsx8
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;