Prevent reverting editable user bio on click

Turns out the click handler was bound to the surrounding element
rather than the one that wraps the rendered bio when it is not
being edited.

Fixes #1145.
This commit is contained in:
Franz Liedke 2017-03-17 22:14:51 +01:00
parent 3f10eeaa88
commit c48ff264e8
2 changed files with 4 additions and 6 deletions

View File

@ -28539,7 +28539,7 @@ System.register('flarum/components/UserBio', ['flarum/Component', 'flarum/compon
content = m(
'div',
{ className: 'UserBio-content' },
{ className: 'UserBio-content', onclick: this.edit.bind(this) },
subContent
);
}
@ -28549,8 +28549,7 @@ System.register('flarum/components/UserBio', ['flarum/Component', 'flarum/compon
{ className: 'UserBio ' + classList({
editable: this.props.editable,
editing: this.editing
}),
onclick: this.edit.bind(this) },
}) },
content
);
}

View File

@ -45,15 +45,14 @@ export default class UserBio extends Component {
}
}
content = <div className="UserBio-content">{subContent}</div>;
content = <div className="UserBio-content" onclick={this.edit.bind(this)}>{subContent}</div>;
}
return (
<div className={'UserBio ' + classList({
editable: this.props.editable,
editing: this.editing
})}
onclick={this.edit.bind(this)}>
})}>
{content}
</div>
);