mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
4264d0d193
commit
b3764d6a20
4 changed files with 10 additions and 5 deletions
|
|
@ -58,10 +58,11 @@ export const previewDocImage = (currentSrc: string, id: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const previewAttrViewImages = (currentSrc: string, avID: string, viewID: string) => {
|
export const previewAttrViewImages = (currentSrc: string, avID: string, viewID: string, query: string) => {
|
||||||
fetchPost("/api/av/getCurrentAttrViewImages", {
|
fetchPost("/api/av/getCurrentAttrViewImages", {
|
||||||
id: avID,
|
id: avID,
|
||||||
viewID: viewID
|
viewID,
|
||||||
|
query,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
previewImages(response.data, currentSrc);
|
previewImages(response.data, currentSrc);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
||||||
(imgElement as HTMLImageElement).src,
|
(imgElement as HTMLImageElement).src,
|
||||||
blockElement.getAttribute("data-av-id"),
|
blockElement.getAttribute("data-av-id"),
|
||||||
blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
||||||
|
(blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || ""
|
||||||
);
|
);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,8 @@ export const editAssetItem = (options: {
|
||||||
previewAttrViewImages(
|
previewAttrViewImages(
|
||||||
linkAddress,
|
linkAddress,
|
||||||
options.blockElement.getAttribute("data-av-id"),
|
options.blockElement.getAttribute("data-av-id"),
|
||||||
options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW)
|
options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
||||||
|
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || ""
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1259,13 +1259,15 @@ export const openMenuPanel = (options: {
|
||||||
)) {
|
)) {
|
||||||
openAsset(options.protyle.app, assetLink.trim(), parseInt(getSearch("page", assetLink)), "right");
|
openAsset(options.protyle.app, assetLink.trim(), parseInt(getSearch("page", assetLink)), "right");
|
||||||
} else if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
|
} else if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
|
||||||
previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW));
|
previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
||||||
|
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || "");
|
||||||
} else {
|
} else {
|
||||||
window.open(assetLink);
|
window.open(assetLink);
|
||||||
}
|
}
|
||||||
/// #else
|
/// #else
|
||||||
if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
|
if (Constants.SIYUAN_ASSETS_IMAGE.includes(suffix)) {
|
||||||
previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW));
|
previewAttrViewImages(assetLink, avID, options.blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
||||||
|
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || "");
|
||||||
} else {
|
} else {
|
||||||
window.open(assetLink);
|
window.open(assetLink);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue