aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-04-10 14:08:22 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-04-10 14:08:22 -0400
commit929512da59d8678ac37c7ac9d0f6c2c9fa968d50 (patch)
tree1476a11a5b083c2e26c1f77b6436014bd8821928 /src/client/documents/Documents.ts
parente4b22138e39244728144fbdd4c06e439be1b519a (diff)
rearranged button/script field keys to -rawscript, -
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 22f22cbfd..b5c6dc06a 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -116,6 +116,7 @@ export interface DocumentOptions {
borderRounding?: string;
boxShadow?: string;
dontRegisterChildren?: boolean;
+ "onClick-rawScript"?:string; // onClick script in raw text form
_pivotField?: string; // field key used to determine headings for sections in stacking, masonry, pivot views
schemaColumns?: List<SchemaHeaderField>;
dockingConfig?: string;
@@ -144,7 +145,6 @@ export interface DocumentOptions {
treeViewChecked?: ScriptField; // script to call when a tree view checkbox is checked
isFacetFilter?: boolean; // whether document functions as a facet filter in a tree view
limitHeight?: number; // maximum height for newly created (eg, from pasting) text documents
- editScriptOnClick?: string; // script field key to edit when document is clicked (e.g., "onClick", "onChecked")
// [key: string]: Opt<Field>;
pointerHack?: boolean; // for buttons, allows onClick handler to fire onPointerDown
textTransform?: string; // is linear view expanded
@@ -247,6 +247,9 @@ export namespace Docs {
[DocumentType.LABEL, {
layout: { view: LabelBox, dataField: data },
}],
+ [DocumentType.BUTTON, {
+ layout: { view: LabelBox, dataField: "onClick" },
+ }],
[DocumentType.SLIDER, {
layout: { view: SliderBox, dataField: data },
}],
@@ -654,7 +657,7 @@ export namespace Docs {
}
export function ButtonDocument(options?: DocumentOptions) {
- return InstanceFromProto(Prototypes.get(DocumentType.LABEL), undefined, { ...(options || {}), editScriptOnClick: "onClick" });
+ return InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" });
}
export function SliderDocument(options?: DocumentOptions) {