From c871ea8d8891b504b09b45a2d1da1103594f1e15 Mon Sep 17 00:00:00 2001 From: madelinegr Date: Tue, 18 Jun 2019 17:04:57 -0400 Subject: WORKING HELLL YYEEEEEEUH --- src/client/views/search/IconButton.tsx | 34 +++++++++++++++++++--------------- src/client/views/search/SearchBox.tsx | 9 ++++++--- src/client/views/search/ToggleBar.tsx | 9 +++------ 3 files changed, 28 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/client/views/search/IconButton.tsx b/src/client/views/search/IconButton.tsx index a684944d7..1894332a1 100644 --- a/src/client/views/search/IconButton.tsx +++ b/src/client/views/search/IconButton.tsx @@ -50,12 +50,14 @@ export class IconButton extends React.Component{ () => IconBar.Instance.ResetClicked, () => { if (IconBar.Instance.ResetClicked) { - this.reset(); - IconBar.Instance.Reset++; - if (IconBar.Instance.Reset === 9) { - IconBar.Instance.Reset = 0; - IconBar.Instance.ResetClicked = false; - } + runInAction(() => { + this.reset(); + IconBar.Instance.Reset++; + if (IconBar.Instance.Reset === 9) { + IconBar.Instance.Reset = 0; + IconBar.Instance.ResetClicked = false; + } + }) } }, ) @@ -63,12 +65,14 @@ export class IconButton extends React.Component{ () => IconBar.Instance.SelectAllClicked, () => { if (IconBar.Instance.SelectAllClicked) { - this.select(); - IconBar.Instance.Select++; - if (IconBar.Instance.Select === 9) { - IconBar.Instance.Select = 0; - IconBar.Instance.SelectAllClicked = false; - } + runInAction(() => { + this.select(); + IconBar.Instance.Select++; + if (IconBar.Instance.Select === 9) { + IconBar.Instance.Select = 0; + IconBar.Instance.SelectAllClicked = false; + } + }) } }, ) @@ -106,11 +110,11 @@ export class IconButton extends React.Component{ onClick = () => { let newList: string[] = SearchBox.Instance.getIcons(); - if(!this.isSelected){ + if (!this.isSelected) { this.isSelected = true; newList.push(this.props.type) } - else{ + else { this.isSelected = false; _.pull(newList, this.props.type) } @@ -186,7 +190,7 @@ export class IconButton extends React.Component{ onMouseLeave={this.onMouseLeave} onClick={this.onClick}>
{this.getFA()}
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 12c21a4e5..755d6a14c 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -116,9 +116,6 @@ export class SearchBox extends React.Component { this._results = results; this._openNoResults = true; }); - - //clears searchstring after search - may not be preferred - this._searchString = ""; } @action @@ -238,10 +235,16 @@ export class SearchBox extends React.Component { } //if true, any keywords can be used. if false, all keywords are required. + @action.bound handleWordQueryChange = () => { this._basicWordStatus = !this._basicWordStatus; } + @action + getBasicWordStatus() { + return this._basicWordStatus; + } + @action.bound updateIcon(newArray: string[]) { this._icons = newArray; diff --git a/src/client/views/search/ToggleBar.tsx b/src/client/views/search/ToggleBar.tsx index b12ef4429..0fee81e20 100644 --- a/src/client/views/search/ToggleBar.tsx +++ b/src/client/views/search/ToggleBar.tsx @@ -19,7 +19,6 @@ export class ToggleBar extends React.Component{ @observable forwardTimeline: anime.AnimeTimelineInstance; @observable _toggleButton: React.RefObject; @observable _originalStatus: boolean = this.props.originalStatus; - @observable _curStatus: boolean = this.props.originalStatus; constructor(props: ToggleBarProps) { super(props); @@ -71,7 +70,6 @@ export class ToggleBar extends React.Component{ @action.bound onclick() { - this._curStatus = !this._curStatus; this.forwardTimeline.play(); this.forwardTimeline.reverse(); SearchBox.Instance.handleWordQueryChange(); @@ -79,11 +77,10 @@ export class ToggleBar extends React.Component{ @action.bound public resetToggle = () => { - if (!this._curStatus) { + if (!SearchBox.Instance.getBasicWordStatus()) { this.forwardTimeline.play() this.forwardTimeline.reverse(); SearchBox.Instance.handleWordQueryChange(); - this._curStatus = true; } } @@ -91,8 +88,8 @@ export class ToggleBar extends React.Component{ return (
-
{this.props.optionOne}
-
{this.props.optionTwo}
+
{this.props.optionOne}
+
{this.props.optionTwo}
-- cgit v1.2.3-70-g09d2