mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 03:40:15 +01:00
This commit is contained in:
parent
013b06dcce
commit
473df4b185
6 changed files with 35 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import {getEventName} from "../util/compatibility";
|
||||
import {updateHotkeyTip} from "../util/compatibility";
|
||||
import {Constants} from "../../constants";
|
||||
|
||||
export class ToolbarItem {
|
||||
public element: HTMLElement;
|
||||
|
|
@ -17,7 +18,11 @@ export class ToolbarItem {
|
|||
}
|
||||
this.element.addEventListener(getEventName(), (event) => {
|
||||
event.preventDefault();
|
||||
protyle.toolbar.setInlineMark(protyle, menuItem.name, "toolbar");
|
||||
if (Constants.INLINE_TYPE.includes(menuItem.name)) {
|
||||
protyle.toolbar.setInlineMark(protyle, menuItem.name, "toolbar");
|
||||
} else if (menuItem.click) {
|
||||
menuItem.click(protyle.getInstance());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,6 +229,9 @@ export class Toolbar {
|
|||
case "a":
|
||||
menuItemObj = new Link(protyle, menuItem);
|
||||
break;
|
||||
default:
|
||||
menuItemObj = new ToolbarItem(protyle, menuItem);
|
||||
break;
|
||||
}
|
||||
if (!menuItemObj) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue