This commit is contained in:
Vanessa 2024-09-13 21:32:11 +08:00
parent ccf6ab6ef2
commit 80252ec1b0
5 changed files with 21 additions and 21 deletions

View file

@ -740,8 +740,8 @@ export class Files extends Model {
window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach((item: filesPath) => { window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach((item: filesPath) => {
item.openPaths.forEach((openPath) => { item.openPaths.forEach((openPath) => {
this.selectItem(item.notebookId, openPath, undefined, false); this.selectItem(item.notebookId, openPath, undefined, false);
}) });
}) });
if (!init) { if (!init) {
return; return;
} }
@ -1065,17 +1065,17 @@ export class Files extends Model {
private getOpenPaths() { private getOpenPaths() {
const filesPaths: filesPath[] = []; const filesPaths: filesPath[] = [];
this.element.querySelectorAll('.b3-list[data-url]').forEach((item: HTMLElement) => { this.element.querySelectorAll(".b3-list[data-url]").forEach((item: HTMLElement) => {
const notebookPaths: filesPath = { const notebookPaths: filesPath = {
notebookId: item.getAttribute("data-url"), notebookId: item.getAttribute("data-url"),
openPaths: [] openPaths: []
} };
item.querySelectorAll(".b3-list-item__arrow--open").forEach((openItem) => { item.querySelectorAll(".b3-list-item__arrow--open").forEach((openItem) => {
const liElement = hasClosestByTag(openItem, "LI"); const liElement = hasClosestByTag(openItem, "LI");
if (liElement) { if (liElement) {
notebookPaths.openPaths.push(liElement.getAttribute("data-path")); notebookPaths.openPaths.push(liElement.getAttribute("data-path"));
} }
}) });
if (notebookPaths.openPaths.length > 0) { if (notebookPaths.openPaths.length > 0) {
for (let i = 0; i < notebookPaths.openPaths.length; i++) { for (let i = 0; i < notebookPaths.openPaths.length; i++) {
for (let j = i + 1; j < notebookPaths.openPaths.length; j++) { for (let j = i + 1; j < notebookPaths.openPaths.length; j++) {

View file

@ -253,13 +253,13 @@ export const copyTab = (app: App, tab: Tab) => {
callback(newTab: Tab) { callback(newTab: Tab) {
let model: Model; let model: Model;
if (tab.model instanceof Editor) { if (tab.model instanceof Editor) {
const newAction: string[] = [] const newAction: string[] = [];
// https://github.com/siyuan-note/siyuan/issues/12132 // https://github.com/siyuan-note/siyuan/issues/12132
tab.model.editor.protyle.block.action.forEach(item => { tab.model.editor.protyle.block.action.forEach(item => {
if (item !== Constants.CB_GET_APPEND && item !== Constants.CB_GET_BEFORE && item !== Constants.CB_GET_HTML) { if (item !== Constants.CB_GET_APPEND && item !== Constants.CB_GET_BEFORE && item !== Constants.CB_GET_HTML) {
newAction.push(item) newAction.push(item);
} }
}) });
model = new Editor({ model = new Editor({
app, app,
tab: newTab, tab: newTab,

View file

@ -321,8 +321,8 @@ export class MobileFiles extends Model {
window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach((item: filesPath) => { window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach((item: filesPath) => {
item.openPaths.forEach((openPath) => { item.openPaths.forEach((openPath) => {
this.selectItem(item.notebookId, openPath, undefined, false); this.selectItem(item.notebookId, openPath, undefined, false);
}) });
}) });
if (!init) { if (!init) {
return; return;
} }
@ -671,17 +671,17 @@ export class MobileFiles extends Model {
private getOpenPaths() { private getOpenPaths() {
const filesPaths: filesPath[] = []; const filesPaths: filesPath[] = [];
this.element.querySelectorAll('.b3-list[data-url]').forEach((item: HTMLElement) => { this.element.querySelectorAll(".b3-list[data-url]").forEach((item: HTMLElement) => {
const notebookPaths: filesPath = { const notebookPaths: filesPath = {
notebookId: item.getAttribute("data-url"), notebookId: item.getAttribute("data-url"),
openPaths: [] openPaths: []
} };
item.querySelectorAll(".b3-list-item__arrow--open").forEach((openItem) => { item.querySelectorAll(".b3-list-item__arrow--open").forEach((openItem) => {
const liElement = hasClosestByTag(openItem, "LI"); const liElement = hasClosestByTag(openItem, "LI");
if (liElement) { if (liElement) {
notebookPaths.openPaths.push(liElement.getAttribute("data-path")); notebookPaths.openPaths.push(liElement.getAttribute("data-path"));
} }
}) });
if (notebookPaths.openPaths.length > 0) { if (notebookPaths.openPaths.length > 0) {
for (let i = 0; i < notebookPaths.openPaths.length; i++) { for (let i = 0; i < notebookPaths.openPaths.length; i++) {
for (let j = i + 1; j < notebookPaths.openPaths.length; j++) { for (let j = i + 1; j < notebookPaths.openPaths.length; j++) {

View file

@ -1900,7 +1900,7 @@ export class Gutter {
private genWidths(nodeElements: Element[], protyle: IProtyle) { private genWidths(nodeElements: Element[], protyle: IProtyle) {
let rangeElement: HTMLInputElement; let rangeElement: HTMLInputElement;
const firstElement = nodeElements[0] as HTMLElement const firstElement = nodeElements[0] as HTMLElement;
const styles: IMenu[] = [{ const styles: IMenu[] = [{
iconHTML: "", iconHTML: "",
type: "readonly", type: "readonly",
@ -1913,7 +1913,7 @@ export class Gutter {
nodeElements.forEach((item: HTMLElement) => { nodeElements.forEach((item: HTMLElement) => {
item.style.width = inputElement.value + "px"; item.style.width = inputElement.value + "px";
item.style.flex = "none"; item.style.flex = "none";
}) });
rangeElement.value = "0"; rangeElement.value = "0";
rangeElement.parentElement.setAttribute("aria-label", inputElement.value + "px"); rangeElement.parentElement.setAttribute("aria-label", inputElement.value + "px");
}); });
@ -1976,14 +1976,14 @@ export class Gutter {
private genHeights(nodeElements: Element[], protyle: IProtyle) { private genHeights(nodeElements: Element[], protyle: IProtyle) {
const matchHeight = nodeElements.find(item => { const matchHeight = nodeElements.find(item => {
if (!item.classList.contains("p") && !item.classList.contains("code-block") && !item.classList.contains("render-node")) { if (!item.classList.contains("p") && !item.classList.contains("code-block") && !item.classList.contains("render-node")) {
return true return true;
} }
}) });
if (matchHeight) { if (matchHeight) {
return; return;
} }
let rangeElement: HTMLInputElement; let rangeElement: HTMLInputElement;
const firstElement = nodeElements[0] as HTMLElement const firstElement = nodeElements[0] as HTMLElement;
const styles: IMenu[] = [{ const styles: IMenu[] = [{
iconHTML: "", iconHTML: "",
type: "readonly", type: "readonly",
@ -1996,7 +1996,7 @@ export class Gutter {
nodeElements.forEach((item: HTMLElement) => { nodeElements.forEach((item: HTMLElement) => {
item.style.height = inputElement.value + "px"; item.style.height = inputElement.value + "px";
item.style.flex = "none"; item.style.flex = "none";
}) });
rangeElement.value = "0"; rangeElement.value = "0";
rangeElement.parentElement.setAttribute("aria-label", inputElement.value + "px"); rangeElement.parentElement.setAttribute("aria-label", inputElement.value + "px");
}); });
@ -2046,7 +2046,7 @@ export class Gutter {
this.genClick(nodeElements, protyle, (e: HTMLElement) => { this.genClick(nodeElements, protyle, (e: HTMLElement) => {
if (e.style.height) { if (e.style.height) {
e.style.height = ""; e.style.height = "";
e.style.overflow = "" e.style.overflow = "";
} }
}); });
} }

View file

@ -170,7 +170,7 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
} }
}; };
} else if (colType === "date") { } else if (colType === "date") {
const dateObj = dayjs(value) const dateObj = dayjs(value);
if (isNaN(dateObj.valueOf())) { if (isNaN(dateObj.valueOf())) {
cellValue = { cellValue = {
type: colType, type: colType,