aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication/models/current_user_utils.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-07 20:36:31 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-07 20:36:31 -0400
commit78e0b57cab3a5fea7421ca4661d890b635bb4790 (patch)
tree71dfb02ad8f662bb595474c9507b7fa5dd2b39fd /src/server/authentication/models/current_user_utils.ts
parentfcd0895e5933270718b9c1a262e7e377eaabb024 (diff)
fixed gear in tab panes showing up. fixed tree view titling. fixed some current_user_util templates to drag as render templates, not prototypes.
Diffstat (limited to 'src/server/authentication/models/current_user_utils.ts')
-rw-r--r--src/server/authentication/models/current_user_utils.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts
index 6e06fe931..8a0fbeabe 100644
--- a/src/server/authentication/models/current_user_utils.ts
+++ b/src/server/authentication/models/current_user_utils.ts
@@ -50,7 +50,7 @@ export class CurrentUserUtils {
);
queryTemplate.isTemplateDoc = makeTemplate(queryTemplate);
doc["template-button-query"] = CurrentUserUtils.ficon({
- onDragStart: ScriptField.MakeFunction('makeDelegate(this.dragFactory, true)'),
+ onDragStart: ScriptField.MakeFunction('getCopy(this.dragFactory, true)'),
dragFactory: new PrefetchProxy(queryTemplate) as any as Doc,
removeDropProperties: new List<string>(["dropAction"]), title: "query view", icon: "question-circle"
});
@@ -66,7 +66,7 @@ export class CurrentUserUtils {
);
slideTemplate.isTemplateDoc = makeTemplate(slideTemplate);
doc["template-button-slides"] = CurrentUserUtils.ficon({
- onDragStart: ScriptField.MakeFunction('makeDelegate(this.dragFactory, true)'),
+ onDragStart: ScriptField.MakeFunction('getCopy(this.dragFactory, true)'),
dragFactory: new PrefetchProxy(slideTemplate) as any as Doc,
removeDropProperties: new List<string>(["dropAction"]), title: "presentation slide", icon: "address-card"
});
@@ -162,7 +162,7 @@ export class CurrentUserUtils {
long.title = "Long Description";
doc["template-button-detail"] = CurrentUserUtils.ficon({
- onDragStart: ScriptField.MakeFunction('makeDelegate(this.dragFactory, true)'),
+ onDragStart: ScriptField.MakeFunction('getCopy(this.dragFactory, true)'),
dragFactory: new PrefetchProxy(detailView) as any as Doc,
removeDropProperties: new List<string>(["dropAction"]), title: "detail view", icon: "window-maximize"
});
@@ -176,7 +176,13 @@ export class CurrentUserUtils {
dropConverter: ScriptField.MakeScript("convertToButtons(dragData)", { dragData: DragManager.DocumentDragData.name }),
}));
} else {
- DocListCast(Cast(doc["template-buttons"], Doc, null)?.data); // prefetch templates
+ const curButnTypes = Cast(doc["template-buttons"], Doc, null);
+ const requiredTypes = [doc["template-button-slides"] as Doc, doc["template-button-description"] as Doc,
+ doc["template-button-query"] as Doc, doc["template-button-detail"] as Doc, doc["template-button-switch"] as Doc];
+ DocListCastAsync(curButnTypes.data).then(async curBtns => {
+ await Promise.all(curBtns!);
+ requiredTypes.map(btype => Doc.AddDocToList(curButnTypes, "data", btype));
+ });
}
return doc["template-buttons"] as Doc;
}