diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-06 01:32:11 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-06 01:32:11 +0530 |
commit | 79b6a250b6924c66733c14c0b5232df85872c1f2 (patch) | |
tree | 77b5f1ccccaead72e3fe4e9a595a48450bfc83d1 /src | |
parent | 70b0d0b1d5890ca87ab2ccb17ea2814724bcb821 (diff) |
fixes to row drop
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 10 | ||||
-rw-r--r-- | src/client/views/collections/CollectionMasonryViewFieldRow.tsx | 11 |
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(); } |