mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 10:50:15 +01:00
This commit is contained in:
parent
90a8e679b3
commit
c845e0acd9
4 changed files with 13 additions and 4 deletions
|
|
@ -97,7 +97,16 @@ export class Menu {
|
|||
window.removeEventListener(isMobile() ? "touchmove" : this.wheelEvent, this.preventDefault, false);
|
||||
}
|
||||
|
||||
public remove() {
|
||||
public remove(isKeyEvent = false) {
|
||||
if (isKeyEvent) {
|
||||
const subElement = window.siyuan.menus.menu.element.querySelector(".b3-menu__item--show");
|
||||
if (subElement) {
|
||||
subElement.classList.remove("b3-menu__item--show");
|
||||
subElement.classList.add("b3-menu__item--current");
|
||||
subElement.querySelector(".b3-menu__item--current")?.classList.remove("b3-menu__item--current");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (window.siyuan.menus.menu.removeCB) {
|
||||
window.siyuan.menus.menu.removeCB();
|
||||
window.siyuan.menus.menu.removeCB = undefined;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue