Skip to content

Commit

Permalink
Fix a bug with needle highlighting
Browse files Browse the repository at this point in the history
cc #186
  • Loading branch information
nrc committed Apr 12, 2018
1 parent aab3d9a commit 5414a0f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions static/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ const utils = require('./utils');

class ResultSet extends React.Component {
componentDidMount() {
this.postRender();
}
componentDidUpdate() {
this.postRender();
}

postRender() {
$(".div_search_results .src_link").removeClass("src_link");
highlight_needle(this.props.input, this.props.kind);
}
Expand Down Expand Up @@ -90,6 +97,13 @@ function FileResult(props) {

class StructuredResultSet extends React.Component {
componentDidMount() {
this.postRender();
}
componentDidUpdate() {
this.postRender();
}

postRender() {
$(".div_search_group .src_link").removeClass("src_link");
const defFile = { file_name: this.props.input.file, lines: [this.props.input.line] };
highlight_needle([defFile], "def");
Expand Down

0 comments on commit 5414a0f

Please sign in to comment.