aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search/CheckBox.tsx
diff options
context:
space:
mode:
authorMonika <monika_hedman@brown.edu>2019-06-20 18:31:58 -0400
committerMonika <monika_hedman@brown.edu>2019-06-20 18:31:58 -0400
commit82e7b6008b4cbab1890235b4b959634ec916d1a1 (patch)
tree95dd02e63aff5cdcf9951e0f3ba2bbbbe3239214 /src/client/views/search/CheckBox.tsx
parent3e6f1e6e2388bcab53c4ee7d680fa6504e82f74d (diff)
checkboxes working
Diffstat (limited to 'src/client/views/search/CheckBox.tsx')
-rw-r--r--src/client/views/search/CheckBox.tsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client/views/search/CheckBox.tsx b/src/client/views/search/CheckBox.tsx
index 26ad9d8ce..24c404892 100644
--- a/src/client/views/search/CheckBox.tsx
+++ b/src/client/views/search/CheckBox.tsx
@@ -10,6 +10,7 @@ interface CheckBoxProps {
title: string;
parent: any;
numCount: number;
+ default: boolean;
}
@observer
@@ -36,6 +37,9 @@ export class CheckBox extends React.Component<CheckBoxProps>{
autoplay: false,
direction: "normal",
});
+
+ // console.log(this.props.getStatus())
+ // console.log(this.props.getStatus)
}
componentDidMount = () => {
@@ -55,6 +59,7 @@ export class CheckBox extends React.Component<CheckBoxProps>{
if (this.props.originalStatus) {
this.checkTimeline.play();
+ this.checkTimeline.restart();
}
this._resetReaction = reaction(
@@ -76,12 +81,18 @@ export class CheckBox extends React.Component<CheckBoxProps>{
@action.bound
reset() {
- if (!this._status) {
+ if(this.props.default){
this._status = true;
this.checkTimeline.play();
this.checkTimeline.restart();
}
+ else{
+ this._status = false;
+ this.uncheckTimeline.play();
+ this.uncheckTimeline.restart();
+ }
+ this.props.updateStatus(this.props.default);
}
@action.bound
@@ -102,7 +113,7 @@ export class CheckBox extends React.Component<CheckBoxProps>{
render() {
return (
- <div className="checkbox" onClick={this.onClick}>
+ <div className="checkboxfilter" onClick={this.onClick}>
<div className="outer">
<div className="check-container">
<svg viewBox="0 12 40 40">