diff options
author | monikahedman <monika_hedman@brown.edu> | 2019-07-19 10:43:52 -0400 |
---|---|---|
committer | monikahedman <monika_hedman@brown.edu> | 2019-07-19 10:43:52 -0400 |
commit | c1fa702ae9e748617121f28cbe65d21cdfdc1f7d (patch) | |
tree | b9d3e9973eddbcae9bbea7f0f98e655e429cf695 /src | |
parent | 98d6476cc1d18617399b28fa670848f97160ffa1 (diff) |
search x
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/search/SearchBox.scss | 5 | ||||
-rw-r--r-- | src/client/views/search/SearchBox.tsx | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/search/SearchBox.scss b/src/client/views/search/SearchBox.scss index 109b88ac9..481ee5789 100644 --- a/src/client/views/search/SearchBox.scss +++ b/src/client/views/search/SearchBox.scss @@ -37,6 +37,11 @@ margin-left: 2px; margin-right: 2px } + + &.searchBox-close { + color: $light-color; + max-height: 32px; + } } } diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index b2a44f448..c45c3aaee 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -4,6 +4,8 @@ import { observable, action, runInAction, flow, computed } from 'mobx'; import "./SearchBox.scss"; import "./FilterBox.scss"; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faTimes } from '@fortawesome/free-solid-svg-icons'; +import { library } from '@fortawesome/fontawesome-svg-core'; import { SetupDrag } from '../../util/DragManager'; import { Docs } from '../../documents/Documents'; import { NumCast, Cast } from '../../../new_fields/Types'; @@ -17,8 +19,9 @@ import { RouteStore } from '../../../server/RouteStore'; import { FilterBox } from './FilterBox'; import { ReadStream } from 'fs'; import * as $ from 'jquery'; +import { MainView } from '../MainView'; - +library.add(faTimes); @observer export class SearchBox extends React.Component { @@ -242,6 +245,7 @@ export class SearchBox extends React.Component { @action.bound closeSearch = () => { + console.log("closing search") FilterBox.Instance.closeFilter(); this.closeResults(); this._searchbarOpen = false; @@ -339,6 +343,7 @@ export class SearchBox extends React.Component { style={{ width: this._searchbarOpen ? "500px" : "100px" }} /> <button className="searchBox-barChild searchBox-submit" onClick={this.submitSearch} onPointerDown={FilterBox.Instance.stopProp}>Submit</button> <button className="searchBox-barChild searchBox-filter" onClick={FilterBox.Instance.openFilter} onPointerDown={FilterBox.Instance.stopProp}>Filter</button> + <button className="searchBox-barChild searchBox-close" title={"Close Search Bar"} onPointerDown={MainView.Instance.toggleSearch}><FontAwesomeIcon icon={faTimes} size="lg" /></button> </div> <div className="searchBox-results" onScroll={this.resultsScrolled} style={{ display: this._resultsOpen ? "flex" : "none", |