From 743cc8b98549dddd4fe5caaa9740caf95a57d56e Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 19 Sep 2020 13:06:32 -0400 Subject: fixed typo that prevented text from being selected. Testing out change to make PDFs always live. --- src/client/views/nodes/PDFBox.tsx | 4 +++- src/client/views/pdf/PDFViewer.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index b199111f9..756ff43f2 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -267,7 +267,9 @@ export class PDFBox extends ViewBoxAnnotatableComponent; } @computed get pdfViewerDiv() { - return
; + return
; } @computed get contentScaling() { return this.props.ContentScaling(); } @computed get standinViews() { -- cgit v1.2.3-70-g09d2 From d4f3dd01976739be98d25d77708856230eb35d3e Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 19 Sep 2020 17:59:00 -0400 Subject: changed Add-Only so that if you have Admin rights to a document you can remove it from a read-only or add-only collection --- src/client/views/DocumentDecorations.tsx | 3 ++- src/client/views/collections/CollectionView.tsx | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 9a49093b4..96eba1869 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -580,7 +580,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> } const canDelete = SelectionManager.SelectedDocuments().some(docView => { const collectionAcl = docView.props.ContainingCollectionView ? GetEffectiveAcl(docView.props.ContainingCollectionDoc?.[DataSym]) : AclEdit; - return !docView.props.Document._stayInCollection && (collectionAcl === AclAdmin || collectionAcl === AclEdit); + const docAcl = GetEffectiveAcl(docView.props.Document); + return !docView.props.Document._stayInCollection && (collectionAcl === AclAdmin || collectionAcl === AclEdit || docAcl === AclAdmin); }); const canOpen = SelectionManager.SelectedDocuments().some(docView => !docView.props.Document._stayInCollection); const closeIcon = !canDelete ? (null) : ( diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 312bc045f..c9496d374 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -185,7 +185,8 @@ export class CollectionView extends Touchable { const effectiveAcl = GetEffectiveAcl(this.props.Document[DataSym]); - if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin) { + const docAcl = GetEffectiveAcl(doc); + if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin || docAcl === AclAdmin) { const docs = doc instanceof Doc ? [doc] : doc as Doc[]; const targetDataDoc = this.props.Document[DataSym]; const value = DocListCast(targetDataDoc[this.props.fieldKey]); @@ -193,8 +194,12 @@ export class CollectionView extends Touchable { - Doc.RemoveDocFromList(targetDataDoc, this.props.fieldKey, doc); - recent && Doc.AddDocToList(recent, "data", doc, undefined, true, true); + const ind = (targetDataDoc[this.props.fieldKey] as List).indexOf(doc); + (targetDataDoc[this.props.fieldKey] as List).splice(ind, 0); + if (ind !== -1) { + Doc.RemoveDocFromList(targetDataDoc, this.props.fieldKey, doc); + recent && Doc.AddDocToList(recent, "data", doc, undefined, true, true); + } }); return true; } -- cgit v1.2.3-70-g09d2 From b9735a34252459ee7f09bb58a49cc3da7a652ab7 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 19 Sep 2020 22:58:47 -0400 Subject: switched from LivePlayground to Playground mode for read-only values. --- src/client/DocServer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 9da5b8632..d7dfa4498 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -42,7 +42,7 @@ export namespace DocServer { export var PlaygroundFields: string[]; export function setPlaygroundFields(livePlaygroundFields: string[]) { DocServer.PlaygroundFields = livePlaygroundFields; - livePlaygroundFields.forEach(f => DocServer.setFieldWriteMode(f, DocServer.WriteMode.LivePlayground)); + livePlaygroundFields.forEach(f => DocServer.setFieldWriteMode(f, DocServer.WriteMode.Playground)); } export function setFieldWriteMode(field: string, writeMode: WriteMode) { -- cgit v1.2.3-70-g09d2