aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index f046af684..d789d4ee3 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -261,7 +261,7 @@ export class DocumentOptions {
presDuration?: number; //the duration of the slide in presentation view
presProgressivize?: boolean;
borderRounding?: string;
- boxShadow?: string;
+ boxShadow?: string; // box-shadow css string OR "standard" to use dash standard box shadow
data?: any;
baseProto?: boolean; // is this a base prototoype
dontRegisterView?: boolean;
@@ -298,7 +298,6 @@ export class DocumentOptions {
linearViewExpandable?: boolean; // can linear view be expanded
linearViewToggleButton?: string; // button to open close linear view group
linearViewSubMenu?: boolean;
- linearViewFloating?: boolean;
flexGap?: number; // Linear view flex gap
flexDirection?: 'unset' | 'row' | 'column' | 'row-reverse' | 'column-reverse';
@@ -335,7 +334,6 @@ export class DocumentOptions {
treeViewHideHeaderIfTemplate?: boolean; // whether to hide the header for a document in a tree view only if a childLayoutTemplate is provided (presBox)
treeViewHideHeader?: boolean; // whether to hide the header for a document in a tree view
treeViewHideHeaderFields?: boolean; // whether to hide the drop down options for tree view items.
- treeViewGrowsHorizontally?: boolean; // whether an embedded tree view of the document can grow horizontally without growing vertically
treeViewChildDoubleClick?: ScriptField; //
// Action Button
buttonMenu?: boolean; // whether a action button should be displayed
@@ -395,7 +393,7 @@ export namespace Docs {
_xMargin: 10,
_yMargin: 10,
nativeDimModifiable: true,
- treeViewGrowsHorizontally: true,
+ nativeHeightUnfrozen: true,
forceReflow: true,
links: '@links(self)',
},
@@ -569,7 +567,7 @@ export namespace Docs {
DocumentType.SLIDER,
{
layout: { view: SliderBox, dataField: defaultDataKey },
- options: { links: '@links(self)', treeViewGrowsHorizontally: true },
+ options: { links: '@links(self)' },
},
],
[
@@ -983,6 +981,7 @@ export namespace Docs {
I.strokeEndMarker = arrowEnd;
I.strokeDash = dash;
I.tool = tool;
+ I.fitWidth = true;
I['text-align'] = 'center';
I.title = 'ink';
I.x = options.x as number;
@@ -1307,7 +1306,7 @@ export namespace DocUtils {
});
}
- export function DefaultFocus(doc: Doc, options?: DocFocusOptions) {
+ export function DefaultFocus(doc: Doc, options: DocFocusOptions) {
options?.afterFocus?.(false);
}
@@ -1384,11 +1383,12 @@ export namespace DocUtils {
);
}
- export function AssignScripts(doc: Doc, scripts?: { [key: string]: string }, funcs?: { [key: string]: string }) {
+ export function AssignScripts(doc: Doc, scripts?: { [key: string]: string | undefined }, funcs?: { [key: string]: string }) {
scripts &&
Object.keys(scripts).map(key => {
- if (ScriptCast(doc[key])?.script.originalScript !== scripts[key] && scripts[key]) {
- doc[key] = ScriptField.MakeScript(scripts[key], {
+ const script = scripts[key];
+ if (ScriptCast(doc[key])?.script.originalScript !== scripts[key] && script) {
+ doc[key] = ScriptField.MakeScript(script, {
dragData: DragManager.DocumentDragData.name,
value: 'any',
_readOnly_: 'boolean',
@@ -1398,14 +1398,17 @@ export namespace DocUtils {
heading: Doc.name,
checked: 'boolean',
containingTreeView: Doc.name,
+ altKey: 'boolean',
+ ctrlKey: 'boolean',
+ shiftKey: 'boolean',
});
}
});
funcs &&
Object.keys(funcs).map(key => {
const cfield = ComputedField.WithoutComputed(() => FieldValue(doc[key]));
- if (ScriptCast(cfield)?.script.originalScript !== funcs[key] && funcs[key]) {
- doc[key] = ComputedField.MakeFunction(funcs[key], { dragData: DragManager.DocumentDragData.name }, { _readOnly_: true });
+ if (ScriptCast(cfield)?.script.originalScript !== funcs[key]) {
+ doc[key] = funcs[key] ? ComputedField.MakeFunction(funcs[key], { dragData: DragManager.DocumentDragData.name }, { _readOnly_: true }) : undefined;
}
});
return doc;
@@ -1901,8 +1904,8 @@ ScriptingGlobals.add(function makeDelegate(proto: any) {
return d;
});
ScriptingGlobals.add(function generateLinkTitle(self: Doc) {
- const anchor1title = self.anchor1 && self.anchor1 !== self ? Cast(self.anchor1, Doc, null).title : '<?>';
- const anchor2title = self.anchor2 && self.anchor2 !== self ? Cast(self.anchor2, Doc, null).title : '<?>';
+ const anchor1title = self.anchor1 && self.anchor1 !== self ? Cast(self.anchor1, Doc, null)?.title : '<?>';
+ const anchor2title = self.anchor2 && self.anchor2 !== self ? Cast(self.anchor2, Doc, null)?.title : '<?>';
const relation = self.linkRelationship || 'to';
return `${anchor1title} (${relation}) ${anchor2title}`;
});