From 4b7fda14ba76fc4244204f8d2b95753f4b46ea22 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Tue, 21 Jul 2015 16:47:08 +0500 Subject: mm-1631 - Fixing image previewer bug --- web/react/components/create_post.jsx | 2 +- web/react/components/view_image.jsx | 9 ++++++--- web/sass-files/sass/partials/_post.scss | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 0c23dcfac..d38a6798f 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -234,7 +234,7 @@ module.exports = React.createClass({ }, render: function() { - var server_error = this.state.server_error ?
: null; + var server_error = this.state.server_error ?
: null; var post_error = this.state.post_error ? : null; var limit_error = this.state.limit_error ?
: null; diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 38f439946..2274f3f2e 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -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); } } }, diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss index 9368786d1..481ed63a5 100644 --- a/web/sass-files/sass/partials/_post.scss +++ b/web/sass-files/sass/partials/_post.scss @@ -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; -- cgit v1.2.3-1-g7c22