This commit is contained in:
Vanessa 2022-12-15 10:41:43 +08:00
parent b00a232fbb
commit 2c9792c239
3 changed files with 28 additions and 28 deletions

View file

@ -909,7 +909,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
if (window.siyuan.dragElement.parentElement?.classList.contains("protyle-gutters") ||
// 列表项之前的点
window.siyuan.dragElement.getAttribute("data-type") === "NodeListItem") {
disabledPosition = ""
disabledPosition = "";
// gutter 文档内拖拽限制
// 排除自己及子孙
const selectedIdsData = window.siyuan.dragElement.getAttribute("data-selected-ids");
@ -938,11 +938,11 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
}
if (window.siyuan.dragElement.getAttribute("data-type") === "NodeListItem" && targetElement.parentElement.classList.contains("li") && targetElement.previousElementSibling?.classList.contains("protyle-action")) {
// 列表项不能拖入列表项中第一个元素之上
disabledPosition = "top"
disabledPosition = "top";
}
if (window.siyuan.dragElement.getAttribute("data-type") === "NodeListItem" && targetElement.nextElementSibling?.classList.contains("list")) {
// 列表项不能拖入列表上方块的下面
disabledPosition = "bottom"
disabledPosition = "bottom";
}
dragoverElement = targetElement;
}

View file

@ -206,13 +206,13 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
const data = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}");
if (config.layout === 1) {
if (data.col) {
edit.protyle.element.style.width = data.col
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.width = data.col;
edit.protyle.element.classList.remove("fn__flex-1");
}
} else {
if (data.row) {
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.height = data.row
edit.protyle.element.classList.remove("fn__flex-1");
edit.protyle.element.style.height = data.row;
}
}
let clickTimeout: number;
@ -222,7 +222,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
replaceInputElement.value = config.r || "";
searchInputElement.select();
const dragElement = element.querySelector(".search__drag")
const dragElement = element.querySelector(".search__drag");
dragElement.addEventListener("mousedown", (event: MouseEvent) => {
const documentSelf = document;
const nextElement = dragElement.nextElementSibling as HTMLElement;
@ -714,13 +714,13 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
current: config.layout === 0,
click() {
element.querySelector(".search__layout").classList.remove("search__layout--row");
edit.protyle.element.style.width = ""
const data = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}")
edit.protyle.element.style.width = "";
const data = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}");
if (data.row) {
edit.protyle.element.style.height = data.row
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.height = data.row;
edit.protyle.element.classList.remove("fn__flex-1");
} else {
edit.protyle.element.classList.add("fn__flex-1")
edit.protyle.element.classList.add("fn__flex-1");
}
setPadding(edit.protyle);
config.layout = 0;
@ -730,13 +730,13 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
current: config.layout === 1,
click() {
element.querySelector(".search__layout").classList.add("search__layout--row");
edit.protyle.element.style.height = ""
const data = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}")
edit.protyle.element.style.height = "";
const data = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}");
if (data.col) {
edit.protyle.element.style.width = data.col
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.width = data.col;
edit.protyle.element.classList.remove("fn__flex-1");
} else {
edit.protyle.element.classList.add("fn__flex-1")
edit.protyle.element.classList.add("fn__flex-1");
}
setPadding(edit.protyle);
config.layout = 1;
@ -807,20 +807,20 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element:
if (item.layout === 0) {
element.querySelector(".search__layout").classList.remove("search__layout--row");
if (data.row) {
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.height = data.row
edit.protyle.element.style.width = ""
edit.protyle.element.classList.remove("fn__flex-1");
edit.protyle.element.style.height = data.row;
edit.protyle.element.style.width = "";
} else {
edit.protyle.element.classList.add("fn__flex-1")
edit.protyle.element.classList.add("fn__flex-1");
}
} else {
element.querySelector(".search__layout").classList.add("search__layout--row");
if (data.col) {
edit.protyle.element.style.width = data.col
edit.protyle.element.classList.remove("fn__flex-1")
edit.protyle.element.style.height = ""
edit.protyle.element.style.width = data.col;
edit.protyle.element.classList.remove("fn__flex-1");
edit.protyle.element.style.height = "";
} else {
edit.protyle.element.classList.add("fn__flex-1")
edit.protyle.element.classList.add("fn__flex-1");
}
}
setPadding(edit.protyle);

View file

@ -110,14 +110,14 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
<div>
<span class="ft__smaller ft__on-surface">${item.hCreated}</span>
<span class="b3-list-item__meta">${window.siyuan.languages.fileSize} ${item.hSize}</span>
<span class="b3-list-item__meta">${window.siyuan.languages.fileCount} ${item.count}</span>`
<span class="b3-list-item__meta">${window.siyuan.languages.fileCount} ${item.count}</span>`;
let statHTML = "";
if (item.typesCount && 0 < item.typesCount.length) {
statHTML += `
<span class="b3-list-item__meta">
${item.typesCount.map((type: { type: string, count: number }) => {
return `${type.type} ${type.count}`;
}).join("&nbsp;&nbsp;")}`
}).join("&nbsp;&nbsp;")}`;
}
repoHTML += `${statHTML}
</span>