mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
This commit is contained in:
parent
d542b58fa9
commit
1e12bfeadd
1 changed files with 16 additions and 14 deletions
|
|
@ -874,20 +874,22 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
const undoOperations: IOperation[] = [];
|
||||
const undoPreviousId = blockElement.querySelector(`[data-id="${selectedIds[0]}"]`).previousElementSibling.getAttribute("data-id") || "";
|
||||
selectedIds.reverse().forEach(item => {
|
||||
doOperations.push({
|
||||
action: "sortAttrViewRow",
|
||||
avID,
|
||||
previousID,
|
||||
id: item,
|
||||
blockID: blockElement.dataset.nodeId,
|
||||
});
|
||||
undoOperations.push({
|
||||
action: "sortAttrViewRow",
|
||||
avID,
|
||||
previousID: undoPreviousId,
|
||||
id: item,
|
||||
blockID: blockElement.dataset.nodeId,
|
||||
});
|
||||
if (previousID !== item) {
|
||||
doOperations.push({
|
||||
action: "sortAttrViewRow",
|
||||
avID,
|
||||
previousID,
|
||||
id: item,
|
||||
blockID: blockElement.dataset.nodeId,
|
||||
});
|
||||
undoOperations.push({
|
||||
action: "sortAttrViewRow",
|
||||
avID,
|
||||
previousID: undoPreviousId,
|
||||
id: item,
|
||||
blockID: blockElement.dataset.nodeId,
|
||||
});
|
||||
}
|
||||
});
|
||||
transaction(protyle, doOperations, undoOperations);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue