mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
4ed3efd7dd
commit
89685b863b
1 changed files with 17 additions and 21 deletions
|
@ -228,31 +228,27 @@ export const openMenuPanel = (options: {
|
|||
return;
|
||||
}
|
||||
if (type === "assets") {
|
||||
const changeData = data.view.filters;
|
||||
let targetFilter: IAVFilter;
|
||||
changeData.find((filter, index: number) => {
|
||||
if (filter.column === sourceId) {
|
||||
targetFilter = changeData.splice(index, 1)[0];
|
||||
return true;
|
||||
}
|
||||
});
|
||||
changeData.find((filter, index: number) => {
|
||||
if (filter.column === targetId) {
|
||||
if (isTop) {
|
||||
changeData.splice(index, 0, targetFilter);
|
||||
targetElement.before(sourceElement)
|
||||
} else {
|
||||
changeData.splice(index + 1, 0, targetFilter);
|
||||
targetElement.after(sourceElement);
|
||||
}
|
||||
return true;
|
||||
const replaceValue: IAVCellAssetValue[] = []
|
||||
Array.from(targetElement.parentElement.children).forEach((item: HTMLElement) => {
|
||||
if (item.dataset.content) {
|
||||
replaceValue.push({
|
||||
content: item.dataset.content,
|
||||
name: item.dataset.name,
|
||||
type: item.dataset.type as "image" | "file",
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
updateAssetCell({
|
||||
protyle:options.protyle,
|
||||
protyle: options.protyle,
|
||||
data,
|
||||
cellElements:options.cellElements,
|
||||
cellElements: options.cellElements,
|
||||
type: "replace",
|
||||
// replaceValue
|
||||
replaceValue
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue