Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context-menu for objects to connected new frontend #31

Closed
thaije opened this issue Jan 30, 2020 · 5 comments
Closed

Add context-menu for objects to connected new frontend #31

thaije opened this issue Jan 30, 2020 · 5 comments
Assignees

Comments

@thaije
Copy link
Collaborator

thaije commented Jan 30, 2020

The new HTML frontend has been connected (partially) to MATRXS in the new-frontend branch.

For the new front-end, it would be nice if a context menu can be opened for any object by clicking on that object. If possible, add the html for the dropdown somewhere on the page just once, and when clicked on an agent (e.g. onClick function), call a function which fills the dropdown with options specific for that agent. This way we only require 1 dropdown html div on the entire page, which makes sense as the user can only open 1 at a time. The filling of the dropdown can be dummy content for now :)

Please also use IDs for objects that are not exactly the obj_ID (obj_ID_dropdown or something is fine), as that will break the front-end otherwise.

@wiardjorritsma
Copy link
Collaborator

@wiardjorritsma
Copy link
Collaborator

@thaije The context menu works in html/agent_1.html but not in the html that is connected to the back-end (templates/god.html). Could you take a look?

Note: if you use templates/god.html, the class selector in this part of context_menu.js should be .object

$(".agent").contextMenu({
menuSelector: "#contextMenu",
menuSelected: function (invokedOn, selectedMenu) {
var msg = "You selected the menu item '" + selectedMenu.text() +
"' on the value '" + invokedOn.text() + "'";
alert(msg);
}
});

@wiardjorritsma
Copy link
Collaborator

It does work on objects hardcoded into the html, but not on object generated in gen_grid.js. In the unconnected front-end, it does work on dynamically generated objects as well.

@thaije
Copy link
Collaborator Author

thaije commented Feb 13, 2020

@wiardjorritsma I fixed the context menu for the connectend frontend. Turned out I already fixed it, but was testing it by left-clicking instead of right-clicking..

@thaije thaije closed this as completed Feb 13, 2020
@wiardjorritsma
Copy link
Collaborator

Haha nice :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants