aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-10 14:05:01 -0400
committerbobzel <zzzman@gmail.com>2024-05-10 14:05:01 -0400
commit4b4d77f99bd55e6de0593c3acd1cf5798ae038bf (patch)
tree0fa27b0344c4252833b9d36dbe69f172141b846e /src/client/views/collections/collectionFreeForm
parente12f79e188c32787b5749eba54183002f270f998 (diff)
added an always option for OpenWhere lightbox. cleaned up/fixed making collections capable of being a lightbox.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index dbd9fb11f..92e29e94a 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -42,7 +42,7 @@ import { DocumentView } from '../../nodes/DocumentView';
import { FieldViewProps } from '../../nodes/FieldView';
import { FocusViewOptions } from '../../nodes/FocusViewOptions';
import { FormattedTextBox } from '../../nodes/formattedText/FormattedTextBox';
-import { OpenWhere } from '../../nodes/OpenWhere';
+import { OpenWhere, OpenWhereMod } from '../../nodes/OpenWhere';
import { PinDocView, PinProps } from '../../PinFuncs';
import { StyleProp } from '../../StyleProp';
import { CollectionSubView } from '../CollectionSubView';
@@ -1066,9 +1066,10 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
/>
);
}
- addDocTab = action((docsIn: Doc | Doc[], where: OpenWhere) => {
+ addDocTab = action((docsIn: Doc | Doc[], location: OpenWhere) => {
const docs = toList(docsIn);
- if (this._props.isAnnotationOverlay) return this._props.addDocTab(docs, where);
+ if (this._props.isAnnotationOverlay) return this._props.addDocTab(docs, location);
+ const where = location.split(':')[0];
switch (where) {
case OpenWhere.inParent:
return this._props.addDocument?.(docs) || false;
@@ -1095,13 +1096,13 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
}
if (firstDoc === this.Document || this.childDocList?.includes(firstDoc) || this.childLayoutPairs.map(pair => pair.layout)?.includes(firstDoc)) {
if (firstDoc.hidden) firstDoc.hidden = false;
- return true;
+ if (!location.includes(OpenWhereMod.always)) return true;
}
}
break;
default:
}
- return this._props.addDocTab(docs, where);
+ return this._props.addDocTab(docs, location);
});
getCalculatedPositions(pair: { layout: Doc; data?: Doc }): PoolData {