diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-04-10 14:08:22 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-04-10 14:08:22 -0400 |
| commit | 929512da59d8678ac37c7ac9d0f6c2c9fa968d50 (patch) | |
| tree | 1476a11a5b083c2e26c1f77b6436014bd8821928 /src/client/documents | |
| parent | e4b22138e39244728144fbdd4c06e439be1b519a (diff) | |
rearranged button/script field keys to -rawscript, -
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/DocumentTypes.ts | 1 | ||||
| -rw-r--r-- | src/client/documents/Documents.ts | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts index ab32d7301..de366763b 100644 --- a/src/client/documents/DocumentTypes.ts +++ b/src/client/documents/DocumentTypes.ts @@ -15,6 +15,7 @@ export enum DocumentType { FONTICON = "fonticonbox", // font icon QUERY = "query", // search query LABEL = "label", // simple text label + BUTTON = "button", // onClick button WEBCAM = "webcam", // webcam PDFANNO = "pdfanno", // pdf text selection (could be just a collection?) DATE = "date", // calendar view of a date 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) { |
