diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-07-21 07:50:49 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-07-21 07:50:49 -0400 |
commit | c4b92424d59ce45fa74556b949c8fe9fc5f79d5a (patch) | |
tree | 555920daad269f5105ebadf17e36ed34b6a4c933 /web | |
parent | a820b67468a13f83098d5d441e524aa7dc70e6e3 (diff) | |
parent | 4b7fda14ba76fc4244204f8d2b95753f4b46ea22 (diff) | |
download | chat-c4b92424d59ce45fa74556b949c8fe9fc5f79d5a.tar.gz chat-c4b92424d59ce45fa74556b949c8fe9fc5f79d5a.tar.bz2 chat-c4b92424d59ce45fa74556b949c8fe9fc5f79d5a.zip |
Merge pull request #216 from asaadmahmoodspin/mm-1631
mm-1631 - Fixing image previewer bug
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/create_post.jsx | 2 | ||||
-rw-r--r-- | web/react/components/view_image.jsx | 9 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_post.scss | 6 |
3 files changed, 13 insertions, 4 deletions
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 ? <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; 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; |