get public link now displays in the same window pane on mobile, but in a new tab on desktop. Also added proptypes
Этот коммит содержится в:
@@ -6,6 +6,13 @@ var utils = require('../utils/utils.jsx');
|
|||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'ViewImageModal',
|
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,
|
canSetState: false,
|
||||||
handleNext: function() {
|
handleNext: function() {
|
||||||
var id = this.state.imgId + 1;
|
var id = this.state.imgId + 1;
|
||||||
@@ -118,7 +125,11 @@ module.exports = React.createClass({
|
|||||||
data.filename = this.props.filenames[this.state.imgId];
|
data.filename = this.props.filenames[this.state.imgId];
|
||||||
Client.getPublicLink(data,
|
Client.getPublicLink(data,
|
||||||
function(serverData) {
|
function(serverData) {
|
||||||
|
if (utils.isMobile()) {
|
||||||
|
window.location.href = serverData.public_link;
|
||||||
|
} else {
|
||||||
window.open(serverData.public_link);
|
window.open(serverData.public_link);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user