forked from mturco/context-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (41 loc) · 1.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!doctype html>
<html>
<head>
<title>ContextMenu</title>
<style>
body {
padding: 20px;
font: 16px sans-serif;
}
div {
float: left;
width: 150px;
height: 150px;
margin-right: 20px;
background-color: #f1f1f1;
border: 1px solid #ccc;
color: #444;
line-height: 150px;
text-align: center;
}
</style>
</head>
<body>
<p>Try right-clicking on each of the boxes below.</p>
<div class="default-theme" tabindex="0">Default theme</div>
<div class="minimal" tabindex="0">No theme</div>
<script src="dist/context-menu.js"></script>
<script>
var items = [
{ name: 'Cut', fn: function(target) { console.log('Cut', target); }},
{ name: 'Copy', fn: function(target) { console.log('Copy', target); }},
{ name: 'Paste', fn: function(target) { console.log('Paste', target); }},
{},
{ name: 'Select All', fn: function(target) { console.log('Select All', target); }},
];
var cm1 = new ContextMenu('.default-theme', items);
var cm2 = new ContextMenu('.minimal', items, { className: 'ContextMenu--theme-custom', minimalStyling: true });
cm1.on('shown', () => console.log('Context menu shown'));
</script>
</body>
</html>