mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
d7627c9e21
commit
67859fb96d
1 changed files with 16 additions and 12 deletions
|
|
@ -200,7 +200,7 @@ export class Outline extends Model {
|
||||||
rightClick: (element: HTMLElement, event: MouseEvent) => {
|
rightClick: (element: HTMLElement, event: MouseEvent) => {
|
||||||
this.showContextMenu(element, event);
|
this.showContextMenu(element, event);
|
||||||
},
|
},
|
||||||
toggleClick:(liElement) => {
|
toggleClick: (liElement) => {
|
||||||
if (!liElement.nextElementSibling) {
|
if (!liElement.nextElementSibling) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -971,7 +971,7 @@ export class Outline extends Model {
|
||||||
fetchPost("/api/block/insertBlock", {
|
fetchPost("/api/block/insertBlock", {
|
||||||
data: "#".repeat(this.getHeadingLevel(element)) + " ",
|
data: "#".repeat(this.getHeadingLevel(element)) + " ",
|
||||||
dataType: "markdown",
|
dataType: "markdown",
|
||||||
nextID: element.getAttribute("data-node-id")
|
nextID: id
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
openFileById({
|
openFileById({
|
||||||
app: this.app,
|
app: this.app,
|
||||||
|
|
@ -987,15 +987,19 @@ export class Outline extends Model {
|
||||||
icon: "iconAfter",
|
icon: "iconAfter",
|
||||||
label: window.siyuan.languages.insertSameLevelHeadingAfter,
|
label: window.siyuan.languages.insertSameLevelHeadingAfter,
|
||||||
click: () => {
|
click: () => {
|
||||||
fetchPost("/api/block/insertBlock", {
|
fetchPost("/api/block/getHeadingDeleteTransaction", {
|
||||||
data: "#".repeat(this.getHeadingLevel(element)) + " ",
|
id,
|
||||||
dataType: "markdown",
|
}, (deleteResponse) => {
|
||||||
previousID: element.getAttribute("data-node-id")
|
fetchPost("/api/block/insertBlock", {
|
||||||
}, (response) => {
|
data: "#".repeat(this.getHeadingLevel(element)) + " ",
|
||||||
openFileById({
|
dataType: "markdown",
|
||||||
app: this.app,
|
previousID: deleteResponse.data.doOperations[deleteResponse.data.doOperations.length - 1].id
|
||||||
id: response.data[0].doOperations[0].id,
|
}, (response) => {
|
||||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_OUTLINE, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]
|
openFileById({
|
||||||
|
app: this.app,
|
||||||
|
id: response.data[0].doOperations[0].id,
|
||||||
|
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_OUTLINE, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1010,7 +1014,7 @@ export class Outline extends Model {
|
||||||
fetchPost("/api/block/prependBlock", {
|
fetchPost("/api/block/prependBlock", {
|
||||||
data: "#".repeat(Math.min(this.getHeadingLevel(element) + 1, 6)) + " ",
|
data: "#".repeat(Math.min(this.getHeadingLevel(element) + 1, 6)) + " ",
|
||||||
dataType: "markdown",
|
dataType: "markdown",
|
||||||
parentID: element.getAttribute("data-node-id")
|
parentID: id
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
if (response.code === 0 && response.data && response.data.length > 0) {
|
if (response.code === 0 && response.data && response.data.length > 0) {
|
||||||
openFileById({
|
openFileById({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue