domino-ui-demo
domino-ui-demo copied to clipboard
Please add an example for a context menu button/icon
As per gitter chat room, it would be nice if next to the drop down buttons we had the option to actually trigger a DropDownMenu from a normal button or icon. This allows for more styling options.
The following code compiles and works as expected for a "Kebap-Menu":
element.appendChild(Icons.ALL.dots_vertical_mdi()
.clickable()
.apply(self -> {
DropDownMenu dropDownMenu = DropDownMenu.create(self);
dropDownMenu.appendChild(DropdownAction.create("value 1")
.addClickListener(evt -> {})
);
dropDownMenu.appendChild(DropdownAction.create("value 2")
.addClickListener(evt -> {})
);
self.addClickListener(evt -> {
dropDownMenu.open();
evt.stopPropagation();
});
}).element());
Please add this to the demo application