This commit is contained in:
Vanessa 2023-12-08 21:36:32 +08:00
parent d601984057
commit f9d476ebf5
5 changed files with 9 additions and 10 deletions

View file

@ -333,7 +333,7 @@ ${data.shorthandContent}
path: pathPosix().join(getDisplayName(toPath[0], false, true), Lute.NewNodeID() + ".sy"),
title: replaceFileName(response.data.shorthandTitle),
md: response.data.shorthandMd,
}, (docResponse) => {
}, () => {
this.remove(item);
});
});

View file

@ -20,7 +20,6 @@ import {needSubscribe} from "../util/needSubscribe";
import * as dayjs from "dayjs";
import {commandPanel} from "../plugin/commandPanel";
import {exportLayout} from "./util";
import {showMessage} from "../dialog/message";
export const initBar = (app: App) => {
const toolbarElement = document.getElementById("toolbar");

View file

@ -125,7 +125,7 @@ const updatePageSize = (currentPageSIze: string, newPageSize: string) => {
if (currentPageSIze === newPageSize) {
return;
}
}
};
export const setPageSize = (target: HTMLElement) => {
const menu = new Menu("av-page-size");
@ -170,4 +170,4 @@ export const setPageSize = (target: HTMLElement) => {
x: rect.left,
y: rect.bottom
});
}
};

View file

@ -330,7 +330,7 @@ export const disabledProtyle = (protyle: IProtyle) => {
protyle.wysiwyg.element.querySelectorAll('.protyle-action[draggable="true"]').forEach(item => {
item.setAttribute("draggable", "false");
});
protyle.wysiwyg.element.querySelectorAll('.av').forEach((item: HTMLElement) => {
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
const headerElement = item.querySelector(".av__row--header") as HTMLElement;
if (headerElement) {
headerElement.style.transform = "";
@ -375,7 +375,7 @@ export const enableProtyle = (protyle: IProtyle) => {
item.setAttribute("draggable", "true");
});
const contentRect = protyle.contentElement.getBoundingClientRect();
protyle.wysiwyg.element.querySelectorAll('.av').forEach((item: HTMLElement) => {
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
stickyRow(item, contentRect, "all");
});
if (protyle.breadcrumb) {

View file

@ -456,8 +456,8 @@ export const softEnter = (range: Range, nodeElement: HTMLElement, protyle: IProt
addNewLineToEnd(range, nodeElement, protyle, startElement);
return true;
}
return false
}
return false;
};
const addNewLineToEnd = (range: Range, nodeElement: HTMLElement, protyle: IProtyle, startElement: Element) => {
const wbrElement = document.createElement("wbr");
@ -468,7 +468,7 @@ const addNewLineToEnd = (range: Range, nodeElement: HTMLElement, protyle: IProty
}
const oldHTML = nodeElement.outerHTML;
wbrElement.remove();
let endNewlineNode
let endNewlineNode;
if (!hasNextSibling(startElement)) {
endNewlineNode = document.createTextNode("\n");
startElement.after(endNewlineNode);
@ -483,4 +483,4 @@ const addNewLineToEnd = (range: Range, nodeElement: HTMLElement, protyle: IProty
range.collapse(true);
focusByRange(range);
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, oldHTML);
}
};