mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +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", {
|
||||
id: avID,
|
||||
viewID: viewID
|
||||
viewID,
|
||||
query,
|
||||
}, (response) => {
|
||||
previewImages(response.data, currentSrc);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
(imgElement as HTMLImageElement).src,
|
||||
blockElement.getAttribute("data-av-id"),
|
||||
blockElement.getAttribute(Constants.CUSTOM_SY_AV_VIEW),
|
||||
(blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement)?.value.trim() || ""
|
||||
);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
|
|||
|
|
@ -341,7 +341,8 @@ export const editAssetItem = (options: {
|
|||
previewAttrViewImages(
|
||||
linkAddress,
|
||||
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");
|
||||
} 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 {
|
||||
window.open(assetLink);
|
||||
}
|
||||
/// #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 {
|
||||
window.open(assetLink);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue