diff options
| author | Melissa Zhang <mzhang19096@gmail.com> | 2020-06-18 22:16:57 -0700 |
|---|---|---|
| committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-06-18 22:16:57 -0700 |
| commit | b79b5ebfd4f8ea8b4ae793e59f05b5bfe79b9b8a (patch) | |
| tree | 3696946f79cd29007e9192fa9a93e5a3a9818a74 /src/client/views/collections/CollectionDockingView.tsx | |
| parent | 8a5c91740f1a8bc4dca2e99bba1da3a1ed1f591b (diff) | |
| parent | d8feecd0542670233e6ea87006a89eb00d10a17e (diff) | |
merge with master
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 6f5a3dfe4..a969e302d 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -8,11 +8,10 @@ import * as GoldenLayout from "../../../client/goldenLayout"; import { DateField } from '../../../fields/DateField'; import { Doc, DocListCast, Field, Opt, DataSym } from "../../../fields/Doc"; import { Id } from '../../../fields/FieldSymbols'; -import { List } from '../../../fields/List'; import { FieldId } from "../../../fields/RefField"; import { Cast, NumCast, StrCast } from "../../../fields/Types"; import { TraceMobx } from '../../../fields/util'; -import { emptyFunction, returnOne, returnTrue, Utils, returnZero } from "../../../Utils"; +import { emptyFunction, returnOne, returnTrue, Utils, returnZero, returnEmptyFilter } from "../../../Utils"; import { DocServer } from "../../DocServer"; import { Docs } from '../../documents/Documents'; import { DocumentManager } from '../../util/DocumentManager'; @@ -44,7 +43,6 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp props: { documentId: document[Id], libraryPath: libraryPath?.map(d => d[Id]) - //collectionDockingView: CollectionDockingView.Instance } }; } @@ -465,7 +463,8 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp if (docids) { const docs = (await Promise.all(docids.map(id => DocServer.GetRefField(id)))).filter(f => f).map(f => f as Doc); - Doc.GetProto(this.props.Document)[this.props.fieldKey] = new List<Doc>(docs); + docs.map(doc => Doc.AddDocToList(Doc.GetProto(this.props.Document), this.props.fieldKey, doc)); + // Doc.GetProto(this.props.Document)[this.props.fieldKey] = new List<Doc>(docs); } } @@ -843,6 +842,7 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> { backgroundColor={CollectionDockingView.Instance.props.backgroundColor} addDocTab={this.addDocTab} pinToPres={DockedFrameRenderer.PinDoc} + docFilters={returnEmptyFilter} ContainingCollectionView={undefined} ContainingCollectionDoc={undefined} />; } @@ -859,5 +859,6 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> { </div >); } } -Scripting.addGlobal(function openOnRight(doc: any) { CollectionDockingView.AddRightSplit(doc); }); +Scripting.addGlobal(function openOnRight(doc: any) { CollectionDockingView.AddRightSplit(doc); }, + "opens up the inputted document on the right side of the screen", "(doc: any)"); Scripting.addGlobal(function useRightSplit(doc: any, shiftKey?: boolean) { CollectionDockingView.UseRightSplit(doc, undefined, shiftKey); }); |
