mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
70c89fcc87
commit
0303234704
1 changed files with 8 additions and 6 deletions
|
|
@ -296,7 +296,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
|
||||||
});
|
});
|
||||||
undoOperations.reverse();
|
undoOperations.reverse();
|
||||||
if (newSourceElement.getAttribute("data-subtype") === "o") {
|
if (newSourceElement.getAttribute("data-subtype") === "o") {
|
||||||
undoOperations.splice(0, 0,{
|
undoOperations.splice(0, 0, {
|
||||||
action: "update",
|
action: "update",
|
||||||
id: newSourceElement.getAttribute("data-node-id"),
|
id: newSourceElement.getAttribute("data-node-id"),
|
||||||
data: newSourceElement.outerHTML
|
data: newSourceElement.outerHTML
|
||||||
|
|
@ -383,7 +383,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
|
||||||
});
|
});
|
||||||
undoOperations.reverse();
|
undoOperations.reverse();
|
||||||
if (newSourceElement.getAttribute("data-subtype") === "o") {
|
if (newSourceElement.getAttribute("data-subtype") === "o") {
|
||||||
undoOperations.splice(0, 0,{
|
undoOperations.splice(0, 0, {
|
||||||
action: "update",
|
action: "update",
|
||||||
id: newSourceElement.getAttribute("data-node-id"),
|
id: newSourceElement.getAttribute("data-node-id"),
|
||||||
data: newSourceElement.outerHTML
|
data: newSourceElement.outerHTML
|
||||||
|
|
@ -590,11 +590,13 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
const selectedIdsData = window.siyuan.dragElement.getAttribute("data-selected-ids");
|
const selectedIdsData = window.siyuan.dragElement.getAttribute("data-selected-ids");
|
||||||
const selectedIds = selectedIdsData ? selectedIdsData.split(",") : [window.siyuan.dragElement.getAttribute("data-node-id")];
|
const selectedIds = selectedIdsData ? selectedIdsData.split(",") : [window.siyuan.dragElement.getAttribute("data-node-id")];
|
||||||
selectedIds.forEach(item => {
|
selectedIds.forEach(item => {
|
||||||
const selectElement = window.siyuan.dragElement.parentElement.parentElement.querySelector(`.protyle-wysiwyg [data-node-id="${item}"]`);
|
window.siyuan.dragElement.parentElement.parentElement.querySelectorAll(`.protyle-wysiwyg [data-node-id="${item}"]`).forEach(elementItem => {
|
||||||
if (selectElement) {
|
if (elementItem.getAttribute("data-type") === "NodeBlockQueryEmbed" ||
|
||||||
sourceElements.push(selectElement);
|
!hasClosestByAttribute(elementItem, "data-type", "NodeBlockQueryEmbed")) {
|
||||||
|
sourceElements.push(elementItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
sourceElements.forEach(item => {
|
sourceElements.forEach(item => {
|
||||||
item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
|
item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
|
||||||
item.removeAttribute("select-start");
|
item.removeAttribute("select-start");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue