mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🚨
This commit is contained in:
parent
3c3e2b8067
commit
e474ceffe1
4 changed files with 19 additions and 19 deletions
|
|
@ -312,7 +312,7 @@ export const bindCardEvent = async (options: {
|
|||
fetchPost("/api/riff/batchSetRiffCardsDueTime", {
|
||||
cardDues: [{
|
||||
id: currentCard.cardID,
|
||||
due: dayjs().add(parseInt(inputElement.value), 'day').format("YYYYMMDDHHmmss")
|
||||
due: dayjs().add(parseInt(inputElement.value), "day").format("YYYYMMDDHHmmss")
|
||||
}]
|
||||
}, () => {
|
||||
actionElements[0].classList.add("fn__none");
|
||||
|
|
|
|||
|
|
@ -309,9 +309,9 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
|
|||
/// #if MOBILE
|
||||
const contentElement = hasClosestByClassName(blockElement, "protyle-content", true);
|
||||
if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") {
|
||||
const keyboardToolbarElement = document.getElementById("keyboardToolbar")
|
||||
const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42)
|
||||
console.log(keyboardH, window.innerHeight, cellRect.bottom)
|
||||
const keyboardToolbarElement = document.getElementById("keyboardToolbar");
|
||||
const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42);
|
||||
console.log(keyboardH, window.innerHeight, cellRect.bottom);
|
||||
if (cellRect.bottom > window.innerHeight - keyboardH - 42) {
|
||||
contentElement.scrollTop += cellRect.bottom - window.innerHeight + 42 + keyboardH;
|
||||
} else if (cellRect.top < 110) {
|
||||
|
|
|
|||
|
|
@ -219,20 +219,20 @@ export const bindSwitcherEvent = (options: { protyle: IProtyle, menuElement: Ele
|
|||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
upDownHint(options.menuElement.querySelector('.fn__flex-1'), event, "b3-menu__item--current");
|
||||
upDownHint(options.menuElement.querySelector(".fn__flex-1"), event, "b3-menu__item--current");
|
||||
if (event.key === "Enter") {
|
||||
const currentElement = options.menuElement.querySelector(".b3-menu__item--current") as HTMLElement;
|
||||
if (currentElement) {
|
||||
options.blockElement.removeAttribute("data-render");
|
||||
avRender(options.blockElement, options.protyle, undefined, currentElement.dataset.id);
|
||||
options.menuElement.remove();
|
||||
focusBlock(options.blockElement)
|
||||
focusBlock(options.blockElement);
|
||||
}
|
||||
} else if (event.key === "Escape") {
|
||||
options.menuElement.remove();
|
||||
focusBlock(options.blockElement)
|
||||
focusBlock(options.blockElement);
|
||||
}
|
||||
})
|
||||
});
|
||||
inputElement.addEventListener("input", (event: InputEvent) => {
|
||||
if (event.isComposing) {
|
||||
return;
|
||||
|
|
@ -242,7 +242,7 @@ export const bindSwitcherEvent = (options: { protyle: IProtyle, menuElement: Ele
|
|||
inputElement.addEventListener("compositionend", () => {
|
||||
filterSwitcher(options.menuElement);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const filterSwitcher = (menuElement: Element) => {
|
||||
const inputElement = menuElement.querySelector(".b3-text-field") as HTMLInputElement;
|
||||
|
|
@ -251,16 +251,16 @@ const filterSwitcher = (menuElement: Element) => {
|
|||
if (!key ||
|
||||
(key.toLowerCase().indexOf(item.textContent.trim().toLowerCase()) > -1 ||
|
||||
item.textContent.trim().toLowerCase().indexOf(key.toLowerCase()) > -1)) {
|
||||
item.classList.remove("fn__none")
|
||||
item.classList.remove("fn__none");
|
||||
} else {
|
||||
item.classList.add("fn__none")
|
||||
item.classList.remove("b3-menu__item--current")
|
||||
item.classList.add("fn__none");
|
||||
item.classList.remove("b3-menu__item--current");
|
||||
}
|
||||
})
|
||||
if (!menuElement.querySelector('.b3-menu__item--current')) {
|
||||
menuElement.querySelector(".fn__flex-1 .b3-menu__item:not(.fn__none)")?.classList.add("b3-menu__item--current")
|
||||
});
|
||||
if (!menuElement.querySelector(".b3-menu__item--current")) {
|
||||
menuElement.querySelector(".fn__flex-1 .b3-menu__item:not(.fn__none)")?.classList.add("b3-menu__item--current");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getSwitcherHTML = (views: IAVView[], viewId: string) => {
|
||||
let html = "";
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
|||
if (isUndo) {
|
||||
return;
|
||||
}
|
||||
const embedElement = isInEmbedBlock(item)
|
||||
const embedElement = isInEmbedBlock(item);
|
||||
if (embedElement) {
|
||||
embedElement.removeAttribute("data-render");
|
||||
blockRender(protyle, embedElement);
|
||||
|
|
@ -1192,7 +1192,7 @@ const processFold = (operation: IOperation, protyle: IProtyle) => {
|
|||
if (operation.action === "unfoldHeading") {
|
||||
const scrollTop = protyle.contentElement.scrollTop;
|
||||
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
|
||||
const embedElement = isInEmbedBlock(item)
|
||||
const embedElement = isInEmbedBlock(item);
|
||||
if (embedElement) {
|
||||
embedElement.removeAttribute("data-render");
|
||||
blockRender(protyle, embedElement);
|
||||
|
|
@ -1224,7 +1224,7 @@ const processFold = (operation: IOperation, protyle: IProtyle) => {
|
|||
return;
|
||||
}
|
||||
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
|
||||
const embedElement = isInEmbedBlock(item)
|
||||
const embedElement = isInEmbedBlock(item);
|
||||
if (embedElement) {
|
||||
embedElement.removeAttribute("data-render");
|
||||
blockRender(protyle, embedElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue