aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormadelinegr <monika_hedman@brown.edu>2019-06-18 16:20:13 -0400
committermadelinegr <monika_hedman@brown.edu>2019-06-18 16:20:13 -0400
commite044f9cd566729a6316c956f34000a164cbc6650 (patch)
treed7c5495294358b4b92aee5bd782e36a80a91221f /src
parentb7f40e897805e84186bb35b84192d3d043a8ebd7 (diff)
things are GOING! code is getting niiiiiiice
Diffstat (limited to 'src')
-rw-r--r--src/client/views/search/IconBar.scss43
-rw-r--r--src/client/views/search/IconBar.tsx4
-rw-r--r--src/client/views/search/IconButton.tsx11
-rw-r--r--src/client/views/search/SearchBox.tsx7
-rw-r--r--src/client/views/search/ToggleBar.tsx7
5 files changed, 6 insertions, 66 deletions
diff --git a/src/client/views/search/IconBar.scss b/src/client/views/search/IconBar.scss
index 2cde14aa7..cb7de15a0 100644
--- a/src/client/views/search/IconBar.scss
+++ b/src/client/views/search/IconBar.scss
@@ -1,6 +1,5 @@
@import "../globalCssVariables";
-
.icon-bar {
display: flex;
justify-content: space-evenly;
@@ -8,7 +7,6 @@
height: 40px;
width: 100%;
flex-wrap: wrap;
- // font-size: 2em;
}
.icon-title {
@@ -30,38 +28,8 @@
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
font-size: 2em;
- // position: absolute;
}
-// .ban-icon {
-// width: 50px;
-// height: 50px;
-// color: $alt-accent;
-// opacity: 0;
-// position: absolute;
-// float: right;
-
-// .fontawesome-icon {
-// height: 100%;
-// width: 100%;
-// }
-// }
-
-// .type-icon.selected.add {
-// background-color: $alt-accent;
-// opacity: 1;
-// }
-
-// .type-icon.selected.removed {
-// background-color: transparent;
-// opacity: .2;
-// }
-
-// .type-icon.not-selected {
-// background-color: transparent;
-// opacity: .6;
-// }
-
.fontawesome-icon {
height: 24px;
width: 24px;
@@ -81,23 +49,12 @@
}
}
-// .type-icon:hover {
-// transform: scale(1.1);
-// // background-color: $alt-accent;
-// opacity: 1;
-
-// +.filter-description {
-// opacity: 1;
-// }
-// }
-
.type-outer {
display: flex;
flex-direction: column;
align-items: center;
width: 45px;
height: 60px;
- // position: relative;
}
.filter-description {
diff --git a/src/client/views/search/IconBar.tsx b/src/client/views/search/IconBar.tsx
index 71fd593ec..9f8f26e82 100644
--- a/src/client/views/search/IconBar.tsx
+++ b/src/client/views/search/IconBar.tsx
@@ -40,7 +40,6 @@ export class IconBar extends React.Component<IconBarProps> {
static Instance: IconBar;
allIcons: string[] = [DocTypes.AUDIO, DocTypes.COL, DocTypes.HIST, DocTypes.IMG, DocTypes.LINK, DocTypes.PDF, DocTypes.TEXT, DocTypes.VID, DocTypes.WEB];
- // @observable typesToFind: string[] = SearchBox.Instance.getIcons();
@observable public ResetClicked: boolean = false;
@observable public SelectAllClicked: boolean = false;
public Reset: number = 0;
@@ -48,7 +47,6 @@ export class IconBar extends React.Component<IconBarProps> {
constructor(props: IconBarProps) {
super(props);
- // console.log("seting")
IconBar.Instance = this;
}
@@ -59,9 +57,7 @@ export class IconBar extends React.Component<IconBarProps> {
@action.bound
updateList(newList: string[]) {
- // this.typesToFind = newList;
SearchBox.Instance.updateIcon(newList)
- // console.log(newList)
}
@action.bound
diff --git a/src/client/views/search/IconButton.tsx b/src/client/views/search/IconButton.tsx
index cdde10fa5..a684944d7 100644
--- a/src/client/views/search/IconButton.tsx
+++ b/src/client/views/search/IconButton.tsx
@@ -28,22 +28,13 @@ library.add(faBan);
interface IconButtonProps {
type: string;
- // getList(): string[];
- // updateList(list: string[]): void;
- // updateSelectedList(type: string): void;
- // active: boolean;
- // getActiveType(): string;
- // changeActiveType(value: string): void;
}
@observer
export class IconButton extends React.Component<IconButtonProps>{
@observable isSelected: boolean = SearchBox.Instance.getIcons().indexOf(this.props.type) !== -1;
- // @observable removeType = false;
@observable hover = false;
- // @observable isRemoved: boolean = (this.props.getActiveType() === "remove");
- // @observable isAdded: boolean = (this.props.getActiveType() === "add");
private _resetReaction?: IReactionDisposer;
private _selectAllReaction?: IReactionDisposer;
@@ -55,8 +46,6 @@ export class IconButton extends React.Component<IconButtonProps>{
}
componentDidMount = () => {
- // console.log(this.props.type, this.isSelected)
-
this._resetReaction = reaction(
() => IconBar.Instance.ResetClicked,
() => {
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index 0983cad3f..711371e49 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -18,7 +18,6 @@ import { SearchUtil } from '../../util/SearchUtil';
import * as anime from 'animejs';
import { updateFunction } from '../../../new_fields/util';
import * as _ from "lodash";
-// import "./globalCssVariables.scss";
import { findDOMNode } from 'react-dom';
import { ToggleBar } from './ToggleBar';
import { IconBar } from './IconBar';
@@ -62,7 +61,7 @@ export class SearchBox extends React.Component {
@action.bound
resetFilters = () => {
ToggleBar.Instance.resetToggle();
- IconBar.Instance.resetIconFilters();
+ IconBar.Instance.selectAll();
// this._wordStatus = true;
this._icons = this.allIcons;
}
@@ -269,7 +268,6 @@ export class SearchBox extends React.Component {
}
getSelected(): any[] {
- console.log(this._selectedTypes)
return this._selectedTypes;
}
@@ -300,13 +298,12 @@ export class SearchBox extends React.Component {
</div>
) : undefined}
</div>
- {/* these all need class names in order to find ancestor - please do not delete */}
{this._open ? (
<div className="filter-form" onPointerDown={this.stopProp} id="filter" style={this._open ? { display: "flex" } : { display: "none" }}>
<div className="filter-form filter-div" id="header">Filter Search Results</div>
<div className="filter-form " id="option">
<div className="required-words filter-div">
- <ToggleBar originalStatus={this._wordStatus} optionOne={"Include Any Keywords"} optionTwo={"Include All Keywords"} changeStatus={this.handleWordQueryChange} />
+ <ToggleBar originalStatus={this._wordStatus} optionOne={"Include Any Keywords"} optionTwo={"Include All Keywords"} />
</div>
<div className="type-of-node filter-div">
<IconBar updateSelected = {this.updateSelected} allIcons = {this.allIcons} updateIcon={this.updateIcon} getIcons={this.getSelected} />
diff --git a/src/client/views/search/ToggleBar.tsx b/src/client/views/search/ToggleBar.tsx
index 32f7a63dd..a3be6f9b8 100644
--- a/src/client/views/search/ToggleBar.tsx
+++ b/src/client/views/search/ToggleBar.tsx
@@ -4,10 +4,11 @@ import { observable, action, runInAction, computed } from 'mobx';
import "./SearchBox.scss";
import "./ToggleBar.scss";
import * as anime from 'animejs';
+import { SearchBox } from './SearchBox';
export interface ToggleBarProps {
//false = right, true = left
- changeStatus(): void;
+ // changeStatus(): void;
originalStatus: boolean;
optionOne: string;
optionTwo: string;
@@ -75,7 +76,7 @@ export class ToggleBar extends React.Component<ToggleBarProps>{
this._curStatus = !this._curStatus;
this.forwardTimeline.play();
this.forwardTimeline.reverse();
- this.props.changeStatus();
+ SearchBox.Instance.handleWordQueryChange();
}
@action.bound
@@ -83,7 +84,7 @@ export class ToggleBar extends React.Component<ToggleBarProps>{
if (!this._curStatus) {
this.forwardTimeline.play()
this.forwardTimeline.reverse();
- this.props.changeStatus();
+ SearchBox.Instance.handleWordQueryChange();
this._curStatus = true;
}
}