rename searchTerms to highlights, and support highlighting multiple search terms
This commit is contained in:
parent
3cc1b1ad82
commit
0b483c4707
4 changed files with 74 additions and 31 deletions
|
@ -43,13 +43,13 @@ module.exports = React.createClass({
|
|||
shouldComponentUpdate: function(nextProps) {
|
||||
// exploit that events are immutable :)
|
||||
return (nextProps.mxEvent.getId() !== this.props.mxEvent.getId() ||
|
||||
nextProps.searchTerm !== this.props.searchTerm);
|
||||
nextProps.highlights !== this.props.highlights);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var mxEvent = this.props.mxEvent;
|
||||
var content = mxEvent.getContent();
|
||||
var body = HtmlUtils.bodyToHtml(content, this.props.searchTerm);
|
||||
var body = HtmlUtils.bodyToHtml(content, this.props.highlights);
|
||||
|
||||
switch (content.msgtype) {
|
||||
case "m.emote":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue