This commit is contained in:
Vanessa 2024-05-27 11:06:54 +08:00
parent 7577933461
commit 19079acfc3
4 changed files with 8 additions and 9 deletions

View file

@ -164,12 +164,12 @@ export const openSnippets = () => {
dialog.element.querySelectorAll('[data-action="search"]').forEach((inputItem: HTMLInputElement) => {
inputItem.addEventListener("input", (event: KeyboardEvent) => {
if (event.isComposing) {
return
return;
}
filterSnippet(dialog, inputItem)
filterSnippet(dialog, inputItem);
});
inputItem.addEventListener("compositionend", () => {
filterSnippet(dialog, inputItem)
filterSnippet(dialog, inputItem);
});
});
});
@ -188,7 +188,7 @@ const filterSnippet = (dialog: Dialog, inputItem: HTMLInputElement) => {
snippetPanel.classList.add("fn__none");
}
});
}
};
const genSnippet = (options: ISnippet) => {
return `<div data-id="${options.id || ""}" data-type="${options.type}">

View file

@ -494,9 +494,9 @@ export const removeAttrViewColAnimation = (blockElement: Element, id: string) =>
export const duplicateCompletely = (protyle:IProtyle, nodeElement:HTMLElement) => {
fetchPost("/api/av/duplicateAttributeViewBlock", {avID: nodeElement.getAttribute("data-av-id")}, (response) => {
nodeElement.classList.remove("protyle-wysiwyg--select")
nodeElement.classList.remove("protyle-wysiwyg--select");
const tempElement = document.createElement("template");
tempElement.innerHTML = protyle.lute.SpinBlockDOM(`<div data-node-id="${response.data.blockID}" data-av-id="${response.data.avID}" data-type="NodeAttributeView" data-av-type="table"></div>`)
tempElement.innerHTML = protyle.lute.SpinBlockDOM(`<div data-node-id="${response.data.blockID}" data-av-id="${response.data.avID}" data-type="NodeAttributeView" data-av-type="table"></div>`);
const cloneElement = tempElement.content.firstElementChild;
nodeElement.after(cloneElement);
avRender(cloneElement, protyle, () => {
@ -513,4 +513,4 @@ export const duplicateCompletely = (protyle:IProtyle, nodeElement:HTMLElement) =
id: response.data.blockID,
}]);
});
}
};

View file

@ -583,7 +583,7 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
link = aElement.getAttribute("data-href");
name = aElement.textContent;
} else {
const imgElement = tempElement.content.querySelector('.img img');
const imgElement = tempElement.content.querySelector(".img img");
if (imgElement) {
imgSrc = imgElement.getAttribute("data-src");
}

View file

@ -13,7 +13,6 @@ import {replaceFileName, validateName} from "../editor/rename";
import {hideElements} from "../protyle/ui/hideElements";
import {openMobileFileById} from "../mobile/editor";
import {App} from "../index";
import {insertHTML} from "../protyle/util/insertHTML";
import {escapeHtml} from "./escape";
export const getNewFilePath = (useSavePath: boolean) => {