JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<div ng-app="testApp" ng-controller="ContextMenuController">
<div class="list-group">
<a href="#"
class="list-group-item"
ng-repeat="item in items"
dr-context-menu="menuOptions">
<span class="badge">{{item.cost}}</span>
{{item.name}}
</a>
</div>
</div>
CSS
body > div,
body > div > div {
padding: 10px;
}
.dropdown-submenu{position:relative;}
.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;}
.dropdown-submenu:hover>.dropdown-menu{display:block;}
.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;}
.dropdown-submenu:hover>a:after{border-left-color:#ffffff;}
.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;}
JavaScript
var app = angular.module('testApp', []);
app.controller('ContextMenuController', ['$scope',
function ($scope) {
$scope.items = [
{ name: 'Right Click Me' },
{ name: 'Right Click Me2'},
{ name: 'Right Click Me3' }
];
$scope.menuOptions = [
{
name: "View", src: "http://icons.iconarchive.com/icons/iconleak/cerulean/256/link-icon.png", hasCheckbox: false, disabled: false,
onClick: function ($itemScope) {
//this function is called when item is clicked
},
subItems: [{
name: "Display all users' tasks", hasCheckbox: true, isCheckBoxChecked: true, disabled: false, onClick: function ($itemScope) {
//this function is called when item is clicked
}
},
{
name: "Show Search Results", hasCheckbox: true, isCheckBoxChecked: false, disabled: false, onClick: function ($itemScope) {
//this function is called when item is clicked
}
}],
},
null,
{
name: "Edit", src: "http://www.iconeasy.com/icon/png/System/Sticker%20Pack%202/Text%20Edit.png", hasCheckbox: false, disabled: false,
onClick: function ($itemScope) {
//this function is called when item is clicked
},
subItems: [
{
name: "Cancel tasks", src: "http://www.iconeasy.com/icon/png/System/Sticker%20Pack%202/Text%20Edit.png", disabled: false, onClick: function ($itemScope) {
//this function is called when item is clicked
}
},
{
...