Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8193738dab
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (35 sloc) 0.998 kb
<!DOCTYPE 5>
<html>
<head>
<title>Menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../build/build.css" />
</head>
<body>
<title>Menu</title>
<script src="../build/build.js"></script>
<script>
var menu = require('menu');
menu = menu();
menu
.add('add-item', 'Add <em>item</em>')
.add('Edit item', function(){ console.log('edit'); })
.add('Remove item', function(){ console.log('remove'); })
.add('Remove "Add item"', function(){
menu.remove('add-item');
menu.remove('Remove "Add item"');
});
menu.on('select', function(item){
console.log('selected "%s"', item);
});
menu.on('Add item', function(){
console.log('added an item');
});
oncontextmenu = function(e){
e.preventDefault();
menu.moveTo(e.pageX, e.pageY);
menu.show();
};
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.