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.ts18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index f96bffb3c..e36103938 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1290,21 +1290,7 @@ export namespace DocUtils {
})) as ContextMenuProps[],
icon: "sticky-note"
});
- const math: ContextMenuProps = ({
- description: ":Math", event: () => {
- const created = Docs.Create.EquationDocument();
- if (created) {
- created.author = Doc.CurrentUserEmail;
- created.x = x;
- created.y = y;
- created.width = 300;
- created.height = 35;
- EquationBox.SelectOnLoad = created[Id];
- docAdder?.(created);
- }
- }, icon: "calculator"
- });
- const documentList: ContextMenuProps[] = DocListCast(Cast(Doc.UserDoc().myItemCreators, Doc, null)?.data).filter(btnDoc => !btnDoc.hidden).map(btnDoc => Cast(btnDoc?.dragFactory, Doc, null)).filter(doc => doc && doc !== Doc.UserDoc().emptyPresentation).map((dragDoc, i) => ({
+ const documentList: ContextMenuProps[] = DocListCast(DocListCast(CurrentUserUtils.MyTools?.data).lastElement()?.data).filter(btnDoc => !btnDoc.hidden).map(btnDoc => Cast(btnDoc?.dragFactory, Doc, null)).filter(doc => doc && doc !== Doc.UserDoc().emptyPresentation).map((dragDoc, i) => ({
description: ":" + StrCast(dragDoc.title),
event: undoBatch((args: { x: number, y: number }) => {
const newDoc = Doc.copyDragFactory(dragDoc);
@@ -1312,13 +1298,13 @@ export namespace DocUtils {
newDoc.author = Doc.CurrentUserEmail;
newDoc.x = x;
newDoc.y = y;
+ EquationBox.SelectOnLoad = newDoc[Id];
if (newDoc.type === DocumentType.RTF) FormattedTextBox.SelectOnLoad = newDoc[Id];
docAdder?.(newDoc);
}
}),
icon: Doc.toIcon(dragDoc),
})) as ContextMenuProps[];
- documentList.push(math);
ContextMenu.Instance.addItem({
description: "Create document",
subitems: documentList,