mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
aa01e99b0d
commit
9dac9aad56
3 changed files with 37 additions and 10 deletions
|
|
@ -49,6 +49,19 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
return true;
|
||||
}
|
||||
|
||||
const searchIconElement = hasClosestByAttribute(event.target, "data-type", "av-search-icon");
|
||||
if (searchIconElement) {
|
||||
const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
|
||||
searchElement.style.width = "128px";
|
||||
searchElement.style.paddingLeft = "";
|
||||
searchElement.style.paddingRight = "";
|
||||
searchElement.focus();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (protyle.disabled) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -115,15 +128,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
} else if (type === "av-search-icon") {
|
||||
const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
|
||||
searchElement.style.width = "128px";
|
||||
searchElement.style.paddingLeft = "";
|
||||
searchElement.style.paddingRight = "";
|
||||
searchElement.focus();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
} else if (type === "av-filter") {
|
||||
openMenuPanel({protyle, blockElement, type: "filters"});
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue