Centralize menu button coordinate logic and replace popupwindows with dropdownmenu.

This commit is contained in:
Jas Singh
2024-07-14 15:13:09 -07:00
parent 6062164652
commit 7a2fdf8647
21 changed files with 89 additions and 109 deletions

View File

@@ -1,4 +1,4 @@
import { closeAllMenus } from "../index.js";
import { openMenu } from "../utils.js";
const Menu = () => {
return {
@@ -10,14 +10,8 @@ const Menu = () => {
}),
isVisible: true,
props: {
on_primary_click: (_, event) => {
const clickPos = event.get_root_coords();
const coords = [clickPos[1], clickPos[2]];
globalMousePos.value = coords;
closeAllMenus();
App.toggleWindow("dashboardmenu");
on_primary_click: (clicked, event) => {
openMenu(clicked, event, "dashboardmenu");
},
},
};