@@ -137,10 +100,6 @@ export default class AttachmentActionsWidget extends BasicWidget {
}
}
- async openAttachmentCommand() {
- await openService.openAttachmentExternally(this.attachmentId, this.attachment.mime);
- }
-
async openAttachmentCustomCommand() {
await openService.openAttachmentCustom(this.attachmentId, this.attachment.mime);
}
diff --git a/apps/client/src/widgets/type_widgets/Attachment.css b/apps/client/src/widgets/type_widgets/Attachment.css
index bbc125a8c..9c5c502d7 100644
--- a/apps/client/src/widgets/type_widgets/Attachment.css
+++ b/apps/client/src/widgets/type_widgets/Attachment.css
@@ -101,4 +101,33 @@
.attachment-detail .attachment-wrapper {
flex-grow: 1;
}
+/* #endregion */
+
+/* #region Attachment actions */
+.attachment-actions {
+ width: 35px;
+ height: 35px;
+}
+
+.attachment-actions .select-button {
+ position: relative;
+ top: 3px;
+}
+
+.attachment-actions .dropdown-menu {
+ width: 20em;
+}
+
+.attachment-actions .dropdown-item .bx {
+ position: relative;
+ top: 3px;
+ font-size: 120%;
+ margin-right: 5px;
+}
+
+.attachment-actions .dropdown-item[disabled], .attachment-actions .dropdown-item[disabled]:hover {
+ color: var(--muted-text-color) !important;
+ background-color: transparent !important;
+ pointer-events: none; /* makes it unclickable */
+}
/* #endregion */
\ No newline at end of file
diff --git a/apps/client/src/widgets/type_widgets/Attachment.tsx b/apps/client/src/widgets/type_widgets/Attachment.tsx
index 6864fd2b2..79d09bcd2 100644
--- a/apps/client/src/widgets/type_widgets/Attachment.tsx
+++ b/apps/client/src/widgets/type_widgets/Attachment.tsx
@@ -12,6 +12,10 @@ import utils from "../../services/utils";
import content_renderer from "../../services/content_renderer";
import { useTriliumEvent } from "../react/hooks";
import froca from "../../services/froca";
+import Dropdown from "../react/Dropdown";
+import Icon from "../react/Icon";
+import { FormListItem } from "../react/FormList";
+import open from "../../services/open";
/**
* Displays the full list of attachments of a note and allows the user to interact with them.
@@ -126,7 +130,7 @@ function AttachmentInfo({ attachment, isFullDetail }: { attachment: FAttachment,
-
+
{!isFullDetail ? (
)
}
+
+function AttachmentActions({ attachment }: { attachment: FAttachment }) {
+ return (
+
+ }
+ buttonClassName="icon-action-always-border"
+ iconAction
+ >
+ open.openAttachmentExternally(attachment.attachmentId, attachment.mime)}
+ >{t("attachments_actions.open_externally")}
+
+
+ )
+}