* Update links in status content on update as well as mount
Fixes occasional bugs with mentions and hashtags not being set to open in a new column like they should, and instead opening in a new page
* use classList instead of raw className
hidden: true,
};
- componentDidMount () {
+ _updateStatusLinks () {
const node = this.node;
const links = node.querySelectorAll('a');
for (var i = 0; i < links.length; ++i) {
- let link = links[i];
+ let link = links[i];
+ if (link.classList.contains('status-link')) {
+ continue;
+ }
+ link.classList.add('status-link');
+
let mention = this.props.status.get('mentions').find(item => link.href === item.get('url'));
if (mention) {
}
}
+ componentDidMount () {
+ this._updateStatusLinks();
+ }
+
componentDidUpdate () {
if (this.props.onHeightUpdate) {
this.props.onHeightUpdate();
}
+ this._updateStatusLinks();
}
onMentionClick = (mention, e) => {