mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
425882cda0
commit
4ccdd38de0
2 changed files with 14 additions and 1 deletions
|
@ -1083,14 +1083,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
const doOperations: IOperation[] = [];
|
const doOperations: IOperation[] = [];
|
||||||
const undoOperations: IOperation[] = [];
|
const undoOperations: IOperation[] = [];
|
||||||
const undoPreviousId = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).previousElementSibling.getAttribute("data-id") || "";
|
const undoPreviousId = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).previousElementSibling.getAttribute("data-id") || "";
|
||||||
|
const targetGroupID = targetElement.parentElement.getAttribute("data-group-id");
|
||||||
selectedIds.reverse().forEach(item => {
|
selectedIds.reverse().forEach(item => {
|
||||||
if (previousID !== item && undoPreviousId !== previousID) {
|
if (previousID !== item && undoPreviousId !== previousID) {
|
||||||
|
const groupID = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).parentElement.getAttribute("data-group-id");
|
||||||
doOperations.push({
|
doOperations.push({
|
||||||
action: "sortAttrViewRow",
|
action: "sortAttrViewRow",
|
||||||
avID,
|
avID,
|
||||||
previousID,
|
previousID,
|
||||||
id: item,
|
id: item,
|
||||||
blockID: blockElement.dataset.nodeId,
|
blockID: blockElement.dataset.nodeId,
|
||||||
|
groupID,
|
||||||
|
targetGroupID,
|
||||||
});
|
});
|
||||||
undoOperations.push({
|
undoOperations.push({
|
||||||
action: "sortAttrViewRow",
|
action: "sortAttrViewRow",
|
||||||
|
@ -1098,6 +1102,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
previousID: undoPreviousId,
|
previousID: undoPreviousId,
|
||||||
id: item,
|
id: item,
|
||||||
blockID: blockElement.dataset.nodeId,
|
blockID: blockElement.dataset.nodeId,
|
||||||
|
groupID: targetGroupID,
|
||||||
|
targetGroupID: groupID,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1144,14 +1150,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
const doOperations: IOperation[] = [];
|
const doOperations: IOperation[] = [];
|
||||||
const undoOperations: IOperation[] = [];
|
const undoOperations: IOperation[] = [];
|
||||||
const undoPreviousId = blockElement.querySelector(`.av__gallery-item[data-id="${selectedIds[0]}"]`).previousElementSibling?.getAttribute("data-id") || "";
|
const undoPreviousId = blockElement.querySelector(`.av__gallery-item[data-id="${selectedIds[0]}"]`).previousElementSibling?.getAttribute("data-id") || "";
|
||||||
|
const targetGroupID = targetElement.parentElement.getAttribute("data-group-id");
|
||||||
selectedIds.reverse().forEach(item => {
|
selectedIds.reverse().forEach(item => {
|
||||||
if (previousID !== item && undoPreviousId !== previousID) {
|
if (previousID !== item && undoPreviousId !== previousID) {
|
||||||
|
const groupID = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).parentElement.getAttribute("data-group-id");
|
||||||
doOperations.push({
|
doOperations.push({
|
||||||
action: "sortAttrViewRow",
|
action: "sortAttrViewRow",
|
||||||
avID,
|
avID,
|
||||||
previousID,
|
previousID,
|
||||||
id: item,
|
id: item,
|
||||||
blockID: blockElement.dataset.nodeId,
|
blockID: blockElement.dataset.nodeId,
|
||||||
|
groupID,
|
||||||
|
targetGroupID,
|
||||||
});
|
});
|
||||||
undoOperations.push({
|
undoOperations.push({
|
||||||
action: "sortAttrViewRow",
|
action: "sortAttrViewRow",
|
||||||
|
@ -1159,6 +1169,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
previousID: undoPreviousId,
|
previousID: undoPreviousId,
|
||||||
id: item,
|
id: item,
|
||||||
blockID: blockElement.dataset.nodeId,
|
blockID: blockElement.dataset.nodeId,
|
||||||
|
groupID: targetGroupID,
|
||||||
|
targetGroupID: groupID,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
@ -552,7 +552,8 @@ interface IOperation {
|
||||||
blockIDs?: string[] // add/removeFlashcards 专享
|
blockIDs?: string[] // add/removeFlashcards 专享
|
||||||
removeDest?: boolean // removeAttrViewCol 专享
|
removeDest?: boolean // removeAttrViewCol 专享
|
||||||
layout?: string // addAttrViewView 专享
|
layout?: string // addAttrViewView 专享
|
||||||
groupID?: string // insertAttrViewBlock 专享
|
groupID?: string // insertAttrViewBlock, sortAttrViewRow 专享
|
||||||
|
targetGroupID?: string // sortAttrViewRow 专享
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IOperationSrcs {
|
interface IOperationSrcs {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue