Skip to content

Build your personal knowledge base with Trilium Notes

refactor(canvas): use better approach to disabling export

Elian Doranabddde910c2d
diff --git a/src/public/app/widgets/type_widgets/canvas.ts b/src/public/app/widgets/type_widgets/canvas.ts
index eddb1f4eba..31fe0ce0e4 100644
--- a/src/public/app/widgets/type_widgets/canvas.ts
+++ b/src/public/app/widgets/type_widgets/canvas.ts
@@ -26,11 +26,6 @@ const TPL = `
.excalidraw-wrapper {
height: 100%;
- }
-
- .excalidraw button[data-testid="json-export-button"] {
- display: none !important;
- }
:root[dir="ltr"]
.excalidraw
@@ -44,10 +39,6 @@ const TPL = `
display: none !important;
}
- button[data-testid='save-button'], button[data-testid='json-export-button'] {
- display: none !important; /* these exports don't work, user should use import/export dialog */
- }
-
.library-button {
display: none !important; /* library won't work without extra support which isn't currently implemented */
}
@@ -558,7 +549,8 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
onLinkOpen,
UIOptions: {
canvasActions: {
- saveToActiveFile: false
+ saveToActiveFile: false,
+ export: false
}
}
})