diff --git a/app/src/config/image.ts b/app/src/config/image.ts
index 93ac63cf1..67cf9c5f9 100644
--- a/app/src/config/image.ts
+++ b/app/src/config/image.ts
@@ -7,6 +7,7 @@ import {fetchPost} from "../util/fetch";
import {getAllModels} from "../layout/getAll";
import {openBy} from "../editor/util";
import {renderAssetsPreview} from "../asset/renderAssets";
+import {writeText} from "../protyle/util/compatibility";
export const image = {
element: undefined as Element,
@@ -87,6 +88,8 @@ export const image = {
event.preventDefault();
event.stopPropagation();
break;
+ } else if (type === "copy") {
+ writeText(target.parentElement.querySelector(".b3-list-item__text").textContent.trim());
} else if (type === "open") {
/// #if !BROWSER
openBy(target.parentElement.getAttribute("data-path"), "folder");
@@ -139,16 +142,23 @@ export const image = {
`;
}
- const boxClearHTML = `
+ let boxClearHTML = ""
+ if (action) {
+ boxClearHTML = `
`;
+ } else {
+ boxClearHTML = `
+
+`;
+ }
data.forEach((item) => {
const idx = item.indexOf("assets/");
const dataPath = item.substr(idx);
html += `
${escapeHtml(item)}
${boxOpenHTML}
- ${action ? boxClearHTML : ""}
+ ${boxClearHTML}
`;
});
element.innerHTML = html || `${window.siyuan.languages.emptyContent}`;