This widget can be used to insert fancy menus in an app window. It's possible to define a menu as an icon and a title. All icons are provided by FontAwesome font; Refer to their documentation to find which icon is available.
gittio install ts.prettymenu
or simplygit clone https://thesmiths-widgets/ts.prettymenu
- Then, copy the content of the assets folder into yours to install fonts
Please, refer to the documentation for more details and options.
index.js
function handleClick (id) {
alert("Menu " + id + "clicked!");
}
$.prettyMenu.init(
[
{ id: "menu:profile", icon: "fa-eye", title: "Mon profil", onClick: handleClick },
{ id: "menu:question", icon: "fa-question", title: "Questions", onClick: handleClick },
{ id: "menu:help", icon: "fa-help", title: "Aide", onClick: handleClick },
{ id: "menu:logout", icon: "fa-flag-o", title: "Deconnexion", onClick: handleClick }
], {
horizontalMargin: 10,
perRow: 2,
verticalMargin: 10,
width: 100
}
);
index.xml
<Alloy>
<Window>
<Widget src="ts.prettymenu" id="prettyMenu" />
</Window>
</Alloy>