aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields
diff options
context:
space:
mode:
Diffstat (limited to 'src/new_fields')
-rw-r--r--src/new_fields/Types.ts4
-rw-r--r--src/new_fields/documentSchemas.ts1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/new_fields/Types.ts b/src/new_fields/Types.ts
index aa44cefa0..3d784448d 100644
--- a/src/new_fields/Types.ts
+++ b/src/new_fields/Types.ts
@@ -88,8 +88,8 @@ export function DateCast(field: FieldResult) {
return Cast(field, DateField, null);
}
-export function ScriptCast(field: FieldResult) {
- return Cast(field, ScriptField, null);
+export function ScriptCast(field: FieldResult, defaultVal: ScriptField | null = null) {
+ return Cast(field, ScriptField, defaultVal);
}
type WithoutList<T extends Field> = T extends List<infer R> ? (R extends RefField ? (R | Promise<R>)[] : R[]) : T;
diff --git a/src/new_fields/documentSchemas.ts b/src/new_fields/documentSchemas.ts
index 7a0be8863..5ca0d681e 100644
--- a/src/new_fields/documentSchemas.ts
+++ b/src/new_fields/documentSchemas.ts
@@ -81,6 +81,7 @@ export const collectionSchema = createSchema({
childLayout: Doc, // layout template for children of a collecion
childDetailView: Doc, // layout template to apply to a child when its clicked on in a collection and opened (requires onChildClick or other script to use this field)
onChildClick: ScriptField, // script to run for each child when its clicked
+ onChildDoubleClick: ScriptField, // script to run for each child when its clicked
onCheckedClick: ScriptField, // script to run when a checkbox is clicked next to a child in a tree view
});