diff options
author | nickago <ngonella@calpoly.edu> | 2015-08-11 14:58:43 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-08-11 14:58:43 -0700 |
commit | 1415560d52eee7bb4f5bdf8b6d433e591273847a (patch) | |
tree | b0d98cf8a4f393092209d87f3d54e88f3b091362 /web | |
parent | 4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e (diff) | |
download | chat-1415560d52eee7bb4f5bdf8b6d433e591273847a.tar.gz chat-1415560d52eee7bb4f5bdf8b6d433e591273847a.tar.bz2 chat-1415560d52eee7bb4f5bdf8b6d433e591273847a.zip |
get public link now displays in the same window pane on mobile, but in a new tab on desktop. Also added proptypes
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/view_image.jsx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index dc85b53e5..0bed4eaa4 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -6,6 +6,13 @@ var utils = require('../utils/utils.jsx'); module.exports = React.createClass({ displayName: 'ViewImageModal', + propTypes: { + filenames: React.PropTypes.array, + modalId: React.PropTypes.string, + channelId: React.PropTypes.string, + userId: React.PropTypes.string, + startId: React.PropTypes.number + }, canSetState: false, handleNext: function() { var id = this.state.imgId + 1; @@ -118,7 +125,11 @@ module.exports = React.createClass({ data.filename = this.props.filenames[this.state.imgId]; Client.getPublicLink(data, function(serverData) { - window.open(serverData.public_link); + if (utils.isMobile()) { + window.location.href = serverData.public_link; + } else { + window.open(serverData.public_link); + } }, function() { } @@ -145,7 +156,7 @@ module.exports = React.createClass({ getInitialState: function() { var loaded = []; var progress = []; - for (var i = 0; i < this.props.filenames.length; i ++) { + for (var i = 0; i < this.props.filenames.length; i++) { loaded.push(false); progress.push(0); } @@ -213,7 +224,7 @@ module.exports = React.createClass({ content = ( <div> <img className='loader-image' src='/static/images/load.gif' /> - { percentage > 0 ? + {percentage > 0 ? <span className='loader-percent' >{'Previewing ' + percentage + '%'}</span> : ''} </div> |