mm-1631 - Fixing image previewer bug
Этот коммит содержится в:
@@ -234,7 +234,7 @@ module.exports = React.createClass({
|
||||
},
|
||||
render: function() {
|
||||
|
||||
var server_error = this.state.server_error ? <div className='form-group has-error'><label className='control-label'>{ this.state.server_error }</label></div> : null;
|
||||
var server_error = this.state.server_error ? <div className='has-error'><label className='control-label'>{ this.state.server_error }</label></div> : null;
|
||||
var post_error = this.state.post_error ? <label className='control-label'>{this.state.post_error}</label> : null;
|
||||
var limit_error = this.state.limit_error ? <div className='has-error'><label className='control-label'>{this.state.limit_error}</label></div> : null;
|
||||
|
||||
|
||||
@@ -25,7 +25,11 @@ module.exports = React.createClass({
|
||||
this.setState({ imgId: nextProps.startId });
|
||||
},
|
||||
loadImage: function(id) {
|
||||
if (this.state.loaded[id] || this.state.images[id]) return;
|
||||
var imgHeight = $(window).height()-100;
|
||||
if (this.state.loaded[id] || this.state.images[id]){
|
||||
$('.modal .modal-image .image-wrapper img').css("max-height",imgHeight);
|
||||
return;
|
||||
};
|
||||
|
||||
var src = "";
|
||||
if (this.props.imgCount > 0) {
|
||||
@@ -48,6 +52,7 @@ module.exports = React.createClass({
|
||||
var loaded = self.state.loaded;
|
||||
loaded[imgid] = true;
|
||||
self.setState({ loaded: loaded });
|
||||
$(self.refs.image.getDOMNode()).css("max-height",imgHeight);
|
||||
};
|
||||
}(id);
|
||||
var images = this.state.images;
|
||||
@@ -56,10 +61,8 @@ module.exports = React.createClass({
|
||||
},
|
||||
componentDidUpdate: function() {
|
||||
if (this.refs.image) {
|
||||
var height = $(window).height()-100;
|
||||
if (this.state.loaded[this.state.imgId]) {
|
||||
$(this.refs.imageWrap.getDOMNode()).removeClass("default");
|
||||
$(this.refs.image.getDOMNode()).css("max-height",height);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -187,6 +187,12 @@ body.ios {
|
||||
.post-create-footer {
|
||||
@include clearfix;
|
||||
padding: 0;
|
||||
.has-error {
|
||||
.control-label {
|
||||
font-weight: normal;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.msg-typing {
|
||||
min-height: 20px;
|
||||
line-height: 18px;
|
||||
|
||||
Ссылка в новой задаче
Block a user