aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/EditableView.tsx
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-08-05 00:07:59 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-08-05 00:07:59 -0400
commit8c7196ca1eda1f89bbac3e2f24219df739978776 (patch)
treea50197ff35955d3bca3e8aa527027ec703449963 /src/client/views/EditableView.tsx
parent02f3d218aa084f00211ffa9e632ea0cdc4d2a531 (diff)
lint
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r--src/client/views/EditableView.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx
index a98ef97ea..a5628d5ee 100644
--- a/src/client/views/EditableView.tsx
+++ b/src/client/views/EditableView.tsx
@@ -187,13 +187,13 @@ export class EditableView extends React.Component<EditableProps> {
}
returnHighlights() {
- let results = [];
- let contents = this.props.bing!();
+ const results = [];
+ const contents = this.props.bing!();
if (contents !== undefined) {
if (this.props.positions !== undefined) {
- let positions = this.props.positions;
- let length = this.props.search!.length;
+ const positions = this.props.positions;
+ const length = this.props.search!.length;
// contents = String(this.props.contents.valueOf());
@@ -201,10 +201,10 @@ export class EditableView extends React.Component<EditableProps> {
positions.forEach((num, cur) => {
results.push(<span style={{ backgroundColor: "#FFFF00", fontStyle: this.props.fontStyle, fontSize: this.props.fontSize, color: this.props.contents ? "black" : "grey" }}>{contents ? contents.slice(num, num + length) : this.props.placeholder?.valueOf()}</span>);
let end = 0;
- cur === positions.length - 1 ? end = contents.length : end = positions[cur + 1];
+ cur === positions.length - 1 ? end = contents!.length : end = positions[cur + 1];
results.push(<span style={{ fontStyle: this.props.fontStyle, fontSize: this.props.fontSize, color: this.props.contents ? "black" : "grey" }}>{contents ? contents.slice(num + length, end) : this.props.placeholder?.valueOf()}</span>);
}
- )
+ );
}
return results;
}