aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-12-11 20:28:11 -0500
committerBob Zeleznik <zzzman@gmail.com>2019-12-11 20:28:11 -0500
commitac3fc59b4574719c22d95910bbbf0430be7de220 (patch)
treee0ee8ab2ca17a3c63bc4b7c1e77765e5d24a8e2f /src/new_fields/Doc.ts
parent4e8605c9e46acd3f3d9080073bdd6e80f049c85a (diff)
got rid of search_match&search_fields. Now have Doc.SearchQuery() and document.searchMatch
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 6f55775fe..17c1b7e16 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -644,6 +644,7 @@ export namespace Doc {
export class DocData {
@observable _user_doc: Doc = undefined!;
+ @observable _searchQuery: string = "";
}
// the document containing the view layout information - will be the Document itself unless the Document has
@@ -651,6 +652,8 @@ export namespace Doc {
export function Layout(doc: Doc) { return Doc.LayoutField(doc) instanceof Doc ? doc[StrCast(doc.layoutKey, "layout")] as Doc : doc; }
export function LayoutField(doc: Doc) { return doc[StrCast(doc.layoutKey, "layout")]; }
const manager = new DocData();
+ export function SearchQuery(): string { return manager._searchQuery; }
+ export function SetSearchQuery(query: string) { runInAction(() => manager._searchQuery = query); }
export function UserDoc(): Doc { return manager._user_doc; }
export function SetUserDoc(doc: Doc) { manager._user_doc = doc; }
export function IsBrushed(doc: Doc) {