mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
aac6ddc1f9
commit
8832304eeb
2 changed files with 4 additions and 7 deletions
|
|
@ -6,8 +6,6 @@ import {cancelSB, genEmptyElement, genSBElement} from "../../block/util";
|
||||||
import {transaction} from "../wysiwyg/transaction";
|
import {transaction} from "../wysiwyg/transaction";
|
||||||
import {getTopAloneElement} from "../wysiwyg/getBlock";
|
import {getTopAloneElement} from "../wysiwyg/getBlock";
|
||||||
import {updateListOrder} from "../wysiwyg/list";
|
import {updateListOrder} from "../wysiwyg/list";
|
||||||
import {hideElements} from "../ui/hideElements";
|
|
||||||
import {mathRender} from "../markdown/mathRender";
|
|
||||||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||||
import {onGet} from "./onGet";
|
import {onGet} from "./onGet";
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
|
|
@ -17,7 +15,6 @@ import {updatePanelByEditor} from "../../editor/util";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {Editor} from "../../editor";
|
import {Editor} from "../../editor";
|
||||||
import {blockRender} from "../markdown/blockRender";
|
import {blockRender} from "../markdown/blockRender";
|
||||||
import {highlightRender} from "../markdown/highlightRender";
|
|
||||||
import {uploadLocalFiles} from "../upload";
|
import {uploadLocalFiles} from "../upload";
|
||||||
import {insertHTML} from "./insertHTML";
|
import {insertHTML} from "./insertHTML";
|
||||||
import {isBrowser} from "../../util/functions";
|
import {isBrowser} from "../../util/functions";
|
||||||
|
|
@ -49,6 +46,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Ele
|
||||||
action: "insert",
|
action: "insert",
|
||||||
data: sbElement.outerHTML,
|
data: sbElement.outerHTML,
|
||||||
id: sbElement.getAttribute("data-node-id"),
|
id: sbElement.getAttribute("data-node-id"),
|
||||||
|
nextID: sbElement.nextElementSibling?.getAttribute("data-node-id"),
|
||||||
previousID: sbElement.previousElementSibling?.getAttribute("data-node-id"),
|
previousID: sbElement.previousElementSibling?.getAttribute("data-node-id"),
|
||||||
parentID: sbElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID
|
parentID: sbElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID
|
||||||
}];
|
}];
|
||||||
|
|
@ -73,8 +71,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Ele
|
||||||
action: "insert",
|
action: "insert",
|
||||||
data: newSourceElement.outerHTML,
|
data: newSourceElement.outerHTML,
|
||||||
id: newSourceElement.getAttribute("data-node-id"),
|
id: newSourceElement.getAttribute("data-node-id"),
|
||||||
previousID: newSourceElement.previousElementSibling?.getAttribute("data-node-id"),
|
nextID: targetElement.getAttribute("data-node-id"),
|
||||||
parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
sourceElements.reverse().forEach((item, index) => {
|
sourceElements.reverse().forEach((item, index) => {
|
||||||
|
|
@ -342,8 +339,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
|
||||||
action: "insert",
|
action: "insert",
|
||||||
data: newSourceElement.outerHTML,
|
data: newSourceElement.outerHTML,
|
||||||
id: newSourceElement.getAttribute("data-node-id"),
|
id: newSourceElement.getAttribute("data-node-id"),
|
||||||
previousID: newSourceElement.previousElementSibling?.getAttribute("data-node-id"),
|
nextID: targetElement.getAttribute("data-node-id"),
|
||||||
parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID
|
|
||||||
});
|
});
|
||||||
sourceElements.reverse().forEach((item, index) => {
|
sourceElements.reverse().forEach((item, index) => {
|
||||||
if (index === sourceElements.length - 1) {
|
if (index === sourceElements.length - 1) {
|
||||||
|
|
|
||||||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -172,6 +172,7 @@ interface IOperation {
|
||||||
parentID?: string
|
parentID?: string
|
||||||
previousID?: string
|
previousID?: string
|
||||||
retData?: any
|
retData?: any
|
||||||
|
nextID?: string // insert 专享
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IObject {
|
interface IObject {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue