mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 13:08:06 +01:00
This commit is contained in:
parent
09fb905764
commit
7bbbc8ae32
5 changed files with 125 additions and 115 deletions
|
|
@ -19,8 +19,8 @@ import {App} from "../../index";
|
|||
import {isHuawei, isInAndroid, isInIOS, isIPhone} from "../../protyle/util/compatibility";
|
||||
import {newFile} from "../../util/newFile";
|
||||
import {afterLoadPlugin} from "../../plugin/loader";
|
||||
import {Menu} from "../../plugin/Menu";
|
||||
import {commandPanel} from "../../boot/globalEvent/command/panel";
|
||||
import {openTopBarMenu} from "../../plugin/openTopBarMenu";
|
||||
|
||||
export const popMenu = () => {
|
||||
activeBlur();
|
||||
|
|
@ -121,14 +121,8 @@ export const initRightMenu = (app: App) => {
|
|||
</a>
|
||||
</div>`;
|
||||
processSync();
|
||||
const unPinsMenu: IMenu[] = [];
|
||||
app.plugins.forEach(item => {
|
||||
const unPinMenu = afterLoadPlugin(item);
|
||||
if (unPinMenu) {
|
||||
unPinMenu.forEach(unpinItem => {
|
||||
unPinsMenu.push(unpinItem);
|
||||
});
|
||||
}
|
||||
afterLoadPlugin(item);
|
||||
});
|
||||
// 只能用 click,否则无法上下滚动 https://github.com/siyuan-note/siyuan/issues/6628
|
||||
menuElement.addEventListener("click", (event) => {
|
||||
|
|
@ -186,11 +180,7 @@ export const initRightMenu = (app: App) => {
|
|||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "menuPlugin") {
|
||||
const menu = new Menu();
|
||||
unPinsMenu.forEach(item => {
|
||||
menu.addItem(item);
|
||||
});
|
||||
menu.fullscreen();
|
||||
openTopBarMenu(app);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue