mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
This commit is contained in:
parent
4312e46d27
commit
683bb5cf50
2 changed files with 63 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ export class Plugin {
|
|||
const iconElement = document.createElement("div");
|
||||
iconElement.className = "toolbar__item b3-tooltips b3-tooltips__sw";
|
||||
iconElement.setAttribute("aria-label", options.title);
|
||||
iconElement.setAttribute("data-menu", "true");
|
||||
iconElement.innerHTML = options.icon.startsWith("icon") ? `<svg><use xlink:href="#${options.icon}"></use></svg>` : options.icon;
|
||||
iconElement.addEventListener("click", options.callback);
|
||||
document.querySelector("#" + (options.position === "right" ? "barSearch" : "drag")).before(iconElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue