mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
Remove delays to close the right-click menu
This commit is contained in:
parent
647a5c948c
commit
4f42be3647
@ -183,8 +183,6 @@ class ContextMenu {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.hide();
|
||||
|
||||
if ("handler" in item && item.handler) {
|
||||
item.handler(item, e);
|
||||
}
|
||||
@ -218,9 +216,6 @@ class ContextMenu {
|
||||
|
||||
async hide() {
|
||||
this.options?.onHide?.();
|
||||
// seems like if we hide the menu immediately, some clicks can get propagated to the underlying component
|
||||
// see https://github.com/zadam/trilium/pull/3805 for details
|
||||
await timeout(100);
|
||||
this.$widget.removeClass("show");
|
||||
this.$cover.removeClass("show");
|
||||
$("body").removeClass("context-menu-shown");
|
||||
@ -228,12 +223,6 @@ class ContextMenu {
|
||||
}
|
||||
}
|
||||
|
||||
function timeout(ms: number) {
|
||||
return new Promise((accept, reject) => {
|
||||
setTimeout(accept, ms);
|
||||
});
|
||||
}
|
||||
|
||||
const contextMenu = new ContextMenu();
|
||||
|
||||
export default contextMenu;
|
||||
|
Loading…
x
Reference in New Issue
Block a user