Merge pull request #284 from nickago/MM-1768
MM-1768 Updated Upload to Select in profile uploader and did cosmetic refactoring
Этот коммит содержится в:
@@ -7,8 +7,8 @@ module.exports = React.createClass({
|
|||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
||||||
var img = this.refs.image.getDOMNode();
|
var img = this.refs.image.getDOMNode();
|
||||||
reader.onload = function (e) {
|
reader.onload = function(e) {
|
||||||
$(img).attr('src', e.target.result)
|
$(img).attr('src', e.target.result);
|
||||||
};
|
};
|
||||||
|
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
@@ -25,27 +25,27 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
var img = null;
|
var img = null;
|
||||||
if (this.props.picture) {
|
if (this.props.picture) {
|
||||||
img = (<img ref="image" className="profile-img" src=""/>);
|
img = (<img ref='image' className='profile-img' src=''/>);
|
||||||
} else {
|
} 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;
|
var self = this;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className="section-max">
|
<ul className='section-max'>
|
||||||
<li className="col-xs-12 section-title">{this.props.title}</li>
|
<li className='col-xs-12 section-title'>{this.props.title}</li>
|
||||||
<li className="col-xs-offset-3 col-xs-8">
|
<li className='col-xs-offset-3 col-xs-8'>
|
||||||
<ul className="setting-list">
|
<ul className='setting-list'>
|
||||||
<li className="setting-list-item">
|
<li className='setting-list-item'>
|
||||||
{img}
|
{img}
|
||||||
</li>
|
</li>
|
||||||
<li className="setting-list-item">
|
<li className='setting-list-item'>
|
||||||
{ server_error }
|
{server_error}
|
||||||
{ client_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>
|
<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={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>
|
<a className='btn btn-sm theme' href='#' onClick={self.props.updateSection}>Cancel</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user