diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-07-30 08:58:56 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-07-30 08:58:56 -0400 |
commit | e699acb808201c160ecfcdad08e1506cd87d174b (patch) | |
tree | 384fb5d06a0a83411df6fe4b7d0e2d1e50f01952 /web/react/components | |
parent | 51e244ab5a04077ed1fd1add32df4aaea8be03cd (diff) | |
parent | 49b7f987091999469d4fc884602eaa5aa8255f77 (diff) | |
download | chat-e699acb808201c160ecfcdad08e1506cd87d174b.tar.gz chat-e699acb808201c160ecfcdad08e1506cd87d174b.tar.bz2 chat-e699acb808201c160ecfcdad08e1506cd87d174b.zip |
Merge pull request #284 from nickago/MM-1768
MM-1768 Updated Upload to Select in profile uploader and did cosmetic refactoring
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/setting_picture.jsx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/web/react/components/setting_picture.jsx b/web/react/components/setting_picture.jsx index 6cfb74d60..fa4c8bb62 100644 --- a/web/react/components/setting_picture.jsx +++ b/web/react/components/setting_picture.jsx @@ -7,8 +7,8 @@ module.exports = React.createClass({ var reader = new FileReader(); var img = this.refs.image.getDOMNode(); - reader.onload = function (e) { - $(img).attr('src', e.target.result) + reader.onload = function(e) { + $(img).attr('src', e.target.result); }; reader.readAsDataURL(file); @@ -25,27 +25,27 @@ module.exports = React.createClass({ var img = null; if (this.props.picture) { - img = (<img ref="image" className="profile-img" src=""/>); + img = (<img ref='image' className='profile-img' src=''/>); } else { - img = (<img ref="image" className="profile-img" src={this.props.src}/>); + img = (<img ref='image' className='profile-img' src={this.props.src}/>); } var self = this; return ( - <ul className="section-max"> - <li className="col-xs-12 section-title">{this.props.title}</li> - <li className="col-xs-offset-3 col-xs-8"> - <ul className="setting-list"> - <li className="setting-list-item"> + <ul className='section-max'> + <li className='col-xs-12 section-title'>{this.props.title}</li> + <li className='col-xs-offset-3 col-xs-8'> + <ul className='setting-list'> + <li className='setting-list-item'> {img} </li> - <li className="setting-list-item"> - { server_error } - { client_error } - <span className="btn btn-sm btn-primary btn-file sel-btn">Upload<input ref="input" accept=".jpg,.png,.bmp" type="file" onChange={this.props.pictureChange}/></span> - <a className={this.props.submitActive ? "btn btn-sm btn-primary" : "btn btn-sm btn-inactive disabled"} onClick={this.props.submit}>Save</a> - <a className="btn btn-sm theme" href="#" onClick={self.props.updateSection}>Cancel</a> + <li className='setting-list-item'> + {server_error} + {client_error} + <span className='btn btn-sm btn-primary btn-file sel-btn'>Select<input ref='input' accept='.jpg,.png,.bmp' type='file' onChange={this.props.pictureChange}/></span> + <a className={this.props.submitActive ? 'btn btn-sm btn-primary' : 'btn btn-sm btn-inactive disabled'} onClick={this.props.submit}>Save</a> + <a className='btn btn-sm theme' href='#' onClick={self.props.updateSection}>Cancel</a> </li> </ul> </li> |