fix changeavatar to avoid duplicate click on label

pull/21833/head
Matthew Hodgson 2016-01-15 16:33:34 +00:00
parent 293f5c7120
commit f476150591
2 changed files with 9 additions and 5 deletions

View File

@ -233,9 +233,11 @@ module.exports = React.createClass({
})} })}
</div> </div>
<div className="mx_UserSettings_avatarPicker" onClick={ this.onAvatarPickerClick } > <div className="mx_UserSettings_avatarPicker">
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl} <div onClick={ this.onAvatarPickerClick }>
showUploadSection={false} className="mx_UserSettings_avatarPicker_img"/> <ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
showUploadSection={false} className="mx_UserSettings_avatarPicker_img"/>
</div>
<div className="mx_UserSettings_avatarPicker_edit"> <div className="mx_UserSettings_avatarPicker_edit">
<label htmlFor="avatarInput" ref="file_label"> <label htmlFor="avatarInput" ref="file_label">
<img src="img/camera.svg" <img src="img/camera.svg"

View File

@ -245,8 +245,10 @@ module.exports = React.createClass({
if (this.props.room) { if (this.props.room) {
if (can_set_room_avatar) { if (can_set_room_avatar) {
roomAvatar = ( roomAvatar = (
<div className="mx_RoomHeader_avatarPicker" onClick={ this.onAvatarPickerClick }> <div className="mx_RoomHeader_avatarPicker">
<ChangeAvatar ref="changeAvatar" room={this.props.room} showUploadSection={false} width={48} height={48} /> <div onClick={ this.onAvatarPickerClick }>
<ChangeAvatar ref="changeAvatar" room={this.props.room} showUploadSection={false} width={48} height={48} />
</div>
<div className="mx_RoomHeader_avatarPicker_edit"> <div className="mx_RoomHeader_avatarPicker_edit">
<label htmlFor="avatarInput" ref="file_label"> <label htmlFor="avatarInput" ref="file_label">
<img src="img/camera.svg" <img src="img/camera.svg"