From f05b323cff1f09c5c84042aa30ad57b2ac74b7cb Mon Sep 17 00:00:00 2001 From: Monika Date: Fri, 21 Jun 2019 13:46:53 -0400 Subject: navicon working --- src/client/views/search/CollectionFilters.tsx | 1 - src/client/views/search/FieldFilters.tsx | 1 - src/client/views/search/IconBar.tsx | 1 - src/client/views/search/NaviconButton.scss | 18 +---- src/client/views/search/NaviconButton.tsx | 39 +++++++++-- src/client/views/search/SearchBox.scss | 26 ++++--- src/client/views/search/SearchBox.tsx | 97 +++++++++++---------------- src/client/views/search/SearchItem.scss | 2 +- 8 files changed, 89 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/src/client/views/search/CollectionFilters.tsx b/src/client/views/search/CollectionFilters.tsx index 5bfe37efb..b8c1579b2 100644 --- a/src/client/views/search/CollectionFilters.tsx +++ b/src/client/views/search/CollectionFilters.tsx @@ -74,7 +74,6 @@ export class CollectionFilters extends React.Component { render() { return (
-
Search in current collections
diff --git a/src/client/views/search/FieldFilters.tsx b/src/client/views/search/FieldFilters.tsx index c7928dcd6..5ad08a7bc 100644 --- a/src/client/views/search/FieldFilters.tsx +++ b/src/client/views/search/FieldFilters.tsx @@ -33,7 +33,6 @@ export class FieldFilters extends React.Component { render() { return (
-
Filter by Basic Keys
diff --git a/src/client/views/search/IconBar.tsx b/src/client/views/search/IconBar.tsx index 2ae4af642..ea8c626ca 100644 --- a/src/client/views/search/IconBar.tsx +++ b/src/client/views/search/IconBar.tsx @@ -68,7 +68,6 @@ export class IconBar extends React.Component { render() { return (
-
Filter by type of node
= React.createRef(); + componentDidMount = () => { - $(document).ready(function () { - var hamburger = $('#hamburger-icon'); - hamburger.click(function () { - hamburger.toggleClass('active'); + // this.ref = React.createRef(); + // $(document).ready(function () { + // var hamburger = $('#hamburger-icon'); + // hamburger.click(function () { + // hamburger.toggleClass('active'); + // console.log("toggling 1") + // return false; + // }); + // }); + + // document.addEventListener("click", this.toggle) + + let that = this; + + if(this.ref.current){this.ref.current.addEventListener("click", function(e) { + e.preventDefault(); + if(that.ref.current){ + that.ref.current.classList.toggle('active'); + console.log("toggling 2") return false; - }); - }); + } + })} + } + // toggle = (e: MouseEvent) => { + // this.ref.current.toggleClass('active'); + // console.log("toggling 2") + // return false; + // } + render() { return ( - + diff --git a/src/client/views/search/SearchBox.scss b/src/client/views/search/SearchBox.scss index 3b96e3922..c65a8b084 100644 --- a/src/client/views/search/SearchBox.scss +++ b/src/client/views/search/SearchBox.scss @@ -32,6 +32,13 @@ } +.filter-title{ + font-size: 18; + text-transform: uppercase; + margin-top: 10px; + margin-bottom: 10px; +} + .searchBox-results { margin-left: 27px; //Is there a better way to do this? } @@ -46,6 +53,11 @@ color: $light-color; flex-direction: column; display: inline-block; + + .filter-header{ + display: flex; + align-items: center; + } } #filter{ @@ -79,20 +91,13 @@ margin-bottom: 5px; } -.type-of-node{ - height: 90px; -} - -.required-words{ +.filter-div{ + margin-top: 10px; + margin-bottom: 10px; display: inline-block; width: 100%; } -.filter-div{ - margin-top: 5px; - margin-bottom: 5px; -} - .collection-title{ color: $light-color; text-transform: uppercase; @@ -109,7 +114,6 @@ height: 50px; text-transform: uppercase; text-align: left; - // width: 80%; font-weight: bold; } diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 71472886f..a76269114 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -409,58 +409,23 @@ export class SearchBox extends React.Component { } @action.bound - updateTitleStatus(newStat: boolean) { - this.titleFieldStatus = newStat; - } - + updateTitleStatus(newStat: boolean) { this.titleFieldStatus = newStat; } @action.bound - updateAuthorStatus(newStat: boolean) { - this.authorFieldStatus = newStat; - } - + updateAuthorStatus(newStat: boolean) { this.authorFieldStatus = newStat; } @action.bound - updateDataStatus(newStat: boolean) { - this.dataFieldStatus = newStat; - } - + updateDataStatus(newStat: boolean) { this.dataFieldStatus = newStat; } @action.bound - updateCollectionStatus(newStat: boolean) { - this.collectionStatus = newStat; - } - + updateCollectionStatus(newStat: boolean) { this.collectionStatus = newStat; } @action.bound - updateSelfCollectionStatus(newStat: boolean) { - this.collectionSelfStatus = newStat; - } - + updateSelfCollectionStatus(newStat: boolean) { this.collectionSelfStatus = newStat; } @action.bound - updateParentCollectionStatus(newStat: boolean) { - this.collectionParentStatus = newStat; - } - - getCollectionStatus() { - return this.collectionStatus; - } - - getSelfCollectionStatus() { - return this.collectionSelfStatus; - } - - getParentCollectionStatus() { - return this.collectionParentStatus; - } - - getTitleStatus() { - return this.titleFieldStatus; - } - - getAuthorStatus() { - return this.authorFieldStatus; - } - - getDataStatus() { - return this.dataFieldStatus; - } + updateParentCollectionStatus(newStat: boolean) { this.collectionParentStatus = newStat; } + getCollectionStatus() { return this.collectionStatus; } + getSelfCollectionStatus() { return this.collectionSelfStatus; } + getParentCollectionStatus() { return this.collectionParentStatus; } + getTitleStatus() { return this.titleFieldStatus; } + getAuthorStatus() { return this.authorFieldStatus; } + getDataStatus() { return this.dataFieldStatus; } // Useful queries: // Delegates of a document: {!join from=id to=proto_i}id:{protoId} @@ -490,26 +455,42 @@ export class SearchBox extends React.Component {
{this._filterOpen ? (
- -
+ +
-
+
+
+
Filter by type of node
+ +
-
- +
+
+
Search in current collections
+ +
+
-
- +
+
Filter by Basic Keys
+ +
+
- +
) : undefined}
diff --git a/src/client/views/search/SearchItem.scss b/src/client/views/search/SearchItem.scss index 6e88d1f44..c82d4bb06 100644 --- a/src/client/views/search/SearchItem.scss +++ b/src/client/views/search/SearchItem.scss @@ -106,7 +106,7 @@ height: 100% } -.collection { +.contexts.collection { border-color: $darker-alt-accent; border-bottom-style: solid; } -- cgit v1.2.3-70-g09d2