diff options
author | bobzel <zzzman@gmail.com> | 2020-08-25 15:05:59 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-25 15:05:59 -0400 |
commit | eca69a005536dec7fcc129bf4fe7c16acb3c9275 (patch) | |
tree | 069e3ec2409130383b56ac574b94f4c80cee1c74 | |
parent | 57458679ffe87302b46c64ffaa05f967c84623df (diff) |
added resize handle for searchbox
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 2 | ||||
-rw-r--r-- | src/client/views/MainView.tsx | 2 | ||||
-rw-r--r-- | src/client/views/collections/CollectionSchemaHeaders.tsx | 3 | ||||
-rw-r--r-- | src/client/views/search/SearchBox.tsx | 14 |
4 files changed, 13 insertions, 8 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 997807ce4..4a51daa9f 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -532,7 +532,7 @@ export class CurrentUserUtils { static setupSearchPanel(doc: Doc) { if (doc.mySearchPanelDoc === undefined) { doc.mySearchPanelDoc = new PrefetchProxy(Docs.Create.SearchDocument({ - _width: 500, _height: 400, backgroundColor: "dimGray", ignoreClick: true, _searchDoc: true, + _width: 500, _height: 300, backgroundColor: "dimGray", ignoreClick: true, _searchDoc: true, childDropAction: "alias", lockedPosition: true, _viewType: CollectionViewType.Schema, _chromeStatus: "disabled", title: "sidebar search stack", system: true })) as any as Doc; } diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 67d1de2ec..33e316dbe 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -186,7 +186,7 @@ export class MainView extends React.Component { fa.faWindowMinimize, fa.faWindowRestore, fa.faTextWidth, fa.faTextHeight, fa.faClosedCaptioning, fa.faInfoCircle, fa.faTag, fa.faSyncAlt, fa.faPhotoVideo, fa.faArrowAltCircleDown, fa.faArrowAltCircleUp, fa.faArrowAltCircleLeft, fa.faArrowAltCircleRight, fa.faStopCircle, fa.faCheckCircle, fa.faGripVertical, fa.faSortUp, fa.faSortDown, fa.faTable, fa.faTh, fa.faThList, fa.faProjectDiagram, fa.faSignature, fa.faColumns, fa.faChevronCircleUp, fa.faUpload, - fa.faBraille, fa.faChalkboard, fa.faPencilAlt, fa.faEyeSlash, fa.faSmile, fa.faIndent, fa.faOutdent, fa.faChartBar, fa.faBan, fa.faPhoneSlash); + fa.faBraille, fa.faChalkboard, fa.faPencilAlt, fa.faEyeSlash, fa.faSmile, fa.faIndent, fa.faOutdent, fa.faChartBar, fa.faBan, fa.faPhoneSlash, fa.faGripLines); this.initEventListeners(); this.initAuthenticationRouters(); } diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx index 03a213002..b2fdf376d 100644 --- a/src/client/views/collections/CollectionSchemaHeaders.tsx +++ b/src/client/views/collections/CollectionSchemaHeaders.tsx @@ -414,12 +414,9 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> { } } const options = keyOptions.map(key => { - //Doc.setDocFilter(this.props.Document!, this._key, key, undefined); let bool = false; - console.log(filters); if (filters !== undefined) { bool = filters.includes(key) && filters[filters.indexOf(key) + 1] === "check"; - console.log(filters.includes(key)); } return <div key={key} className="key-option" style={{ border: "1px solid lightgray", paddingLeft: 5, textAlign: "left", diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 4bffc89ea..5739c2a67 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -10,7 +10,7 @@ import { List } from '../../../fields/List'; import { createSchema, listSpec, makeInterface } from '../../../fields/Schema'; import { SchemaHeaderField } from '../../../fields/SchemaHeaderField'; import { Cast, NumCast, StrCast } from '../../../fields/Types'; -import { returnFalse, returnZero } from '../../../Utils'; +import { returnFalse, returnZero, setupMoveUpEvents, emptyFunction } from '../../../Utils'; import { Docs } from '../../documents/Documents'; import { DocumentType } from "../../documents/DocumentTypes"; import { SetupDrag } from '../../util/DragManager'; @@ -443,7 +443,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc getTransform = () => this.props.ScreenToLocalTransform().translate(-5, -65);// listBox padding-left and pres-box-cont minHeight panelHeight = () => this.props.PanelHeight(); selectElement = (doc: Doc) => { /* this.gotoDocument(this.childDocs.indexOf(doc), NumCasst(this.layoutDoc._itemIndex)); */ }; - returnHeight = () => 31 + 31 * 6; + returnHeight = () => NumCast(this.layoutDoc._height); returnLength = () => Math.min(window.innerWidth, 51 + 205 * Cast(this.props.Document._schemaHeaders, listSpec(SchemaHeaderField), []).length); @action @@ -532,7 +532,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc {!this._searchbarOpen ? (null) : <div style={{ zIndex: 20000, color: "black" }} ref={(r) => r?.focus()}> <div style={{ display: "flex", justifyContent: "center", }}> - <div style={{ display: this.open ? "flex" : "none", overflow: "auto", }}> + <div style={{ display: this.open ? "flex" : "none", overflow: "auto", position: "absolute" }}> <CollectionSchemaView {...this.props} CollectionView={undefined} annotationsKey={""} @@ -546,6 +546,14 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc focus={this.selectElement} ScreenToLocalTransform={Transform.Identity} /> + <div style={{ position: "absolute", right: 5, bottom: 7, width: 15, height: 15, }} + onPointerDown={e => setupMoveUpEvents(this, e, (e: PointerEvent, down: number[], delta: number[]) => { + this.props.Document._height = NumCast(this.props.Document._height) + delta[1]; + return false; + }, returnFalse, emptyFunction)} + > + <FontAwesomeIcon icon="grip-lines" size="lg" /> + </div> </div> </div> </div> |