aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/PropertiesView.tsx10
-rw-r--r--src/client/views/collections/CollectionMasonryViewFieldRow.tsx11
2 files changed, 18 insertions, 3 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 46f38795c..041eec2b4 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -387,7 +387,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
/**
- * @returns the sharing and permissiosn panel.
+ * @returns the sharing and permissions panel.
*/
@computed get sharingTable() {
const AclMap = new Map<symbol, string>([
@@ -907,6 +907,14 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</div>
{!this.openSharing ? (null) :
<div className="propertiesView-sharing-content">
+ {!novice ? (<div className="propertiesView-acls-checkbox">
+ <Checkbox
+ color="primary"
+ onChange={action(() => this.layoutDocAcls = !this.layoutDocAcls)}
+ checked={this.layoutDocAcls}
+ />;
+ <div className="propertiesView-acls-checkbox-text">Layout</div>
+ </div>) : (null)}
{this.sharingTable}
{/* <div className="change-buttons">
<button
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index dd4f01a88..1b6f047ea 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -2,7 +2,7 @@ import React = require("react");
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { action, computed, observable, runInAction } from "mobx";
import { observer } from "mobx-react";
-import { Doc, DataSym } from "../../../fields/Doc";
+import { Doc, DocListCast } from "../../../fields/Doc";
import { PastelSchemaPalette, SchemaHeaderField } from "../../../fields/SchemaHeaderField";
import { ScriptField } from "../../../fields/ScriptField";
import { StrCast, NumCast } from "../../../fields/Types";
@@ -90,7 +90,14 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
this.props.parent.Document.dropConverter.script.run({ dragData: de.complete.docDragData });
const key = StrCast(this.props.parent.props.Document._pivotField);
const castedValue = this.getValue(this.heading);
- de.complete.docDragData.droppedDocuments.forEach(d => d[key] = d[DataSym][key] = castedValue);
+ let onLayoutDoc = false;
+ for (const doc of DocListCast(this.props.parent.Document.data)) {
+ if (Doc.Get(doc, key, true)) {
+ onLayoutDoc = true;
+ break;
+ }
+ }
+ de.complete.docDragData.droppedDocuments.forEach(d => Doc.SetInPlace(d, key, castedValue, !onLayoutDoc));
this.props.parent.onInternalDrop(e, de);
e.stopPropagation();
}