mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
474a490f32
commit
dc90ac1ec7
4 changed files with 8 additions and 4 deletions
|
|
@ -15,12 +15,13 @@ export const addClearButton = (options: {
|
|||
inputElement: HTMLInputElement,
|
||||
clearCB?: () => void,
|
||||
right?: number,
|
||||
width?: string,
|
||||
height?: number
|
||||
className?: string
|
||||
}) => {
|
||||
options.inputElement.dataset.oldPaddingRight = options.inputElement.style.paddingRight;
|
||||
options.inputElement.insertAdjacentHTML("afterend",
|
||||
`<svg class="${options.className || "b3-form__icon-clear"} ariaLabel" aria-label="${window.siyuan.languages.clear}" style="${options.right ? "right: " + options.right + "px;" : ""}${options.height ? "height:" + options.height + "px" : ""}">
|
||||
`<svg class="${options.className || "b3-form__icon-clear"} ariaLabel" aria-label="${window.siyuan.languages.clear}" style="${options.right ? "right: " + options.right + "px;" : ""}${options.height ? "height:" + options.height + "px;" : ""}${options.width ? "width:" + options.width : ""}">
|
||||
<use xlink:href="#iconCloseRound"></use></svg>`);
|
||||
const clearElement = options.inputElement.nextElementSibling;
|
||||
clearElement.addEventListener("click", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue