From 9f8b48837a202af92600fc2fe2d0de06baf0032b Mon Sep 17 00:00:00 2001 From: Monika Date: Thu, 20 Jun 2019 19:24:17 -0400 Subject: end of day 6/20, filter form not reopening correctly --- src/client/views/search/CheckBox.tsx | 5 +-- src/client/views/search/CollectionFilters.scss | 1 + src/client/views/search/CollectionFilters.tsx | 43 +++++++++++++++++++++++--- src/client/views/search/SearchBox.scss | 3 +- src/client/views/search/ToggleBar.scss | 2 +- 5 files changed, 43 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/client/views/search/CheckBox.tsx b/src/client/views/search/CheckBox.tsx index 24c404892..9f0b75887 100644 --- a/src/client/views/search/CheckBox.tsx +++ b/src/client/views/search/CheckBox.tsx @@ -37,9 +37,6 @@ export class CheckBox extends React.Component{ autoplay: false, direction: "normal", }); - - // console.log(this.props.getStatus()) - // console.log(this.props.getStatus) } componentDidMount = () => { @@ -71,7 +68,7 @@ export class CheckBox extends React.Component{ this.props.parent.resetCounter++; if (this.props.parent.resetCounter === this.props.numCount) { this.props.parent.resetCounter = 0; - this.props.parent.resetCounter = false; + this.props.parent.resetBoolean = false; } }); } diff --git a/src/client/views/search/CollectionFilters.scss b/src/client/views/search/CollectionFilters.scss index 5e1f4effc..8d5ab96e7 100644 --- a/src/client/views/search/CollectionFilters.scss +++ b/src/client/views/search/CollectionFilters.scss @@ -16,4 +16,5 @@ display: grid; grid-template-columns: 50% 50%; float: right; + opacity: 0; } \ No newline at end of file diff --git a/src/client/views/search/CollectionFilters.tsx b/src/client/views/search/CollectionFilters.tsx index 8d1aa1294..a5e479567 100644 --- a/src/client/views/search/CollectionFilters.tsx +++ b/src/client/views/search/CollectionFilters.tsx @@ -7,6 +7,7 @@ import { Keys } from './SearchBox'; import "./SearchBox.scss"; import "./CollectionFilters.scss"; import { FieldFilters } from './FieldFilters'; +import * as anime from 'animejs'; interface CollectionFilterProps { collectionStatus: boolean; @@ -23,27 +24,59 @@ export class CollectionFilters extends React.Component { @observable public resetBoolean = false; @observable public resetCounter: number = 0; + @observable collectionsSelected = this.props.collectionStatus; + @observable timeline: anime.AnimeTimelineInstance; + @observable ref: any; - constructor(props:CollectionFilterProps){ + constructor(props: CollectionFilterProps) { super(props); CollectionFilters.Instance = this; + this.ref = React.createRef(); + + this.timeline = anime.timeline({ + loop: false, + autoplay: false, + direction: "reverse", + }); + } + + componentDidMount = () => { + this.timeline.add({ + targets: this.ref.current, + easing: "easeInOutQuad", + duration: 500, + opacity: 1, + }); } + @action.bound resetCollectionFilters() { this.resetBoolean = true; } + @action.bound + updateColStat(val: boolean) { + this.props.updateCollectionStatus(val); + + if (this.collectionsSelected !== val) { + this.timeline.play(); + this.timeline.reverse(); + } + + this.collectionsSelected = val; + } + render() { return (
Search in current collections
- +
-
- - +
+ +
diff --git a/src/client/views/search/SearchBox.scss b/src/client/views/search/SearchBox.scss index 486ec9a93..3b96e3922 100644 --- a/src/client/views/search/SearchBox.scss +++ b/src/client/views/search/SearchBox.scss @@ -84,7 +84,8 @@ } .required-words{ - height: 110px; + display: inline-block; + width: 100%; } .filter-div{ diff --git a/src/client/views/search/ToggleBar.scss b/src/client/views/search/ToggleBar.scss index 3a262709d..633a194fe 100644 --- a/src/client/views/search/ToggleBar.scss +++ b/src/client/views/search/ToggleBar.scss @@ -10,7 +10,7 @@ padding: 5px; .toggle-option { - width: 100px; + width: 50%; text-align: center; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -- cgit v1.2.3-70-g09d2