// Example, with own buttons in component
<span onclick="dialog:my-dialog">Show a dialog</span>
// Example, with OK button to close
<span onclick="dialog:my-dialog/ok">Show a dialog</span>
// Example
<span onclick="menu:my-menu">Foobar</span>
<span oncontextmenu="menu:my-menu">Barfoo</span>
// my-menu.js
export default [
["IC_RELOAD_APP", "reload_app"],
["IC_COMMUNITIES", null,[
["IC_NEWS", "show_news_site"],
["IC_GROUP", "show_group_site"],
["IC_FEEDBACK", "show_feedb_site"]
]],
["IC_ABOUT","show_about"]
];
// EOF
// See Sobuuk source code for details
ui.show_menu(Ev,Ele,Menu);
Params to ui.show_menu:
click or contextmenunull value for contextmenu case to use mouse coords
null if having childrenCtx_Span.on("click",Ev=>{
ui.show_menu(Ev,Ctx_Span,[
[__h("IC_ADD_FOLDER"), this.add_folder],
[__h("IC_RENAME_COLLECTION"), this.rename_coll],
[__h("IC_ADD_TO_PINS"), this.add_coll_to_pins],
[__h("IC_REMOVE_FROM_PINS"), this.rem_coll_from_pins],
["---sep---"],
["Test with children",null,[
["Child 1"],
["Child 2"]
]],
[__h("IC_DELETE_COLLECTION"), this.del_coll],
]);
});
Ctx_Span.on("contextmenu",Ev=>{
ui.show_menu(Ev,null,[
["Item 1"],
["Item 2"],
["Item 3"],
]);
});