From b3f1e5f60ee4a00522d3e4b0b03495685bde006c Mon Sep 17 00:00:00 2001 From: Abdullah Ahmed Date: Tue, 21 May 2019 16:31:45 -0400 Subject: testing --- src/server/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/index.ts b/src/server/index.ts index af99b116a..83c0bc222 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -310,6 +310,7 @@ function setField(socket: Socket, newValue: Transferable) { if (newValue.type === Types.Text) { Search.Instance.updateDocument({ id: newValue.id, data: (newValue as any).data }); console.log("set field"); + console.log("checking in"); } } -- cgit v1.2.3-70-g09d2 From 2f1e56285750bcce6820ba2e1f24b7ad112b9db4 Mon Sep 17 00:00:00 2001 From: ab Date: Tue, 21 May 2019 17:11:17 -0400 Subject: search bar ui fixes --- src/client/views/MainView.tsx | 20 +++++++++++++++++++- src/client/views/SearchBox.tsx | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 6169466bc..aa34a12ed 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -40,6 +40,7 @@ export class MainView extends React.Component { @observable private _workspacesShown: boolean = false; @observable public pwidth: number = 0; @observable public pheight: number = 0; + private searchbox: React.RefObject; @computed private get mainContainer(): Opt { return FieldValue(Cast(CurrentUserUtils.UserDocument.activeWorkspace, Doc)); @@ -56,6 +57,7 @@ export class MainView extends React.Component { constructor(props: Readonly<{}>) { super(props); MainView.Instance = this; + this.searchbox = React.createRef(); // causes errors to be generated when modifying an observable outside of an action configure({ enforceActions: "observed" }); if (window.location.search.includes("readonly")) { @@ -260,17 +262,33 @@ export class MainView extends React.Component { return [ ,
+
, -
, +
,
]; } + @action + toggleSearch = () => { + const sb = this.searchbox.current; + if (sb !== null) { + console.log("toggle search") + if (sb.style.display === "none") { + sb.style.display = "block"; + } + else { + sb.style.display = "none"; + } + } + + } + render() { return (
diff --git a/src/client/views/SearchBox.tsx b/src/client/views/SearchBox.tsx index 0ec1a6758..911fc8d9c 100644 --- a/src/client/views/SearchBox.tsx +++ b/src/client/views/SearchBox.tsx @@ -171,8 +171,8 @@ export class SearchBox extends React.Component { - - + {/* */} + {/* */}
{this._resultsOpen ? (
-- cgit v1.2.3-70-g09d2 From 2c4026368078e2dc856c1cf4f8fe375cd30fbcdd Mon Sep 17 00:00:00 2001 From: ab Date: Tue, 21 May 2019 18:03:27 -0400 Subject: alt and linking --- src/client/util/DocumentManager.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index a5e768dcf..82776ff59 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -125,10 +125,20 @@ export class DocumentManager { } let docView = DocumentManager.Instance.getDocumentView(doc); if (docView) { - docView.props.focus(docView.props.Document); + console.log("navigating to linked doc..."); + // using makecopy as a flag for splitting linked to doc to the right...can change later if needed + if (makeCopy) { + if (!contextDoc) { + const actualDoc = Doc.MakeAlias(docDelegate); + (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); + } + } + else { + docView.props.focus(docView.props.Document); + } } else { if (!contextDoc) { - const actualDoc = docDelegate ? (makeCopy ? Doc.MakeCopy(docDelegate) : docDelegate) : Doc.MakeDelegate(doc); + const actualDoc = Doc.MakeAlias(docDelegate); (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); } else { let contextView = DocumentManager.Instance.getDocumentView(contextDoc); -- cgit v1.2.3-70-g09d2