|
3 | 3 | <head>
|
4 | 4 | <link rel="stylesheet" href="build.css">
|
5 | 5 | <script src="../react.js"></script>
|
6 |
| - <script src="build.js"></script> |
7 | 6 | <style>
|
8 | 7 | body {
|
9 | 8 | height: 400px;
|
|
23 | 22 | </button>
|
24 | 23 | <div id="something">Here's a menu</div>
|
25 | 24 | <div id="output"></div>
|
26 |
| - <script> |
27 |
| - |
28 |
| -var React = require('react') |
29 |
| - , output = document.getElementById('output') |
30 |
| - |
31 |
| -function makeMenu(e) { |
32 |
| - e.preventDefault() |
33 |
| - Menu.show([ |
34 |
| - {title: 'hello'}, |
35 |
| - {title: 'awesome', action: log.bind(null, 'Custom action')}, |
36 |
| - {title: 'One'}, |
37 |
| - {title: 'Two'}, |
38 |
| - {title: 'Three', children: [ |
39 |
| - {title: 'Three One'}, |
40 |
| - {title: 'Three Two', children: [ |
41 |
| - {title: 'awesome', action: log.bind(null, 'Custom action')}, |
42 |
| - {title: 'One'}, |
43 |
| - {title: 'Two some is more and things are here it is long'}, |
44 |
| - ]}, |
45 |
| - ]}, |
46 |
| - {title: 'Four'}, |
47 |
| - ], e.pageX, e.pageY, logItem) |
48 |
| -} |
49 |
| - |
50 |
| -window.something.addEventListener('contextmenu', makeMenu) |
51 |
| - |
52 |
| -function showmenu() { |
53 |
| - Menu.show([ |
54 |
| - {title: 'hello'}, |
55 |
| - {title: 'awesome', action: log.bind(null, 'Custom action')}, |
56 |
| - ], 100, 100, logItem) |
57 |
| -} |
58 |
| - |
59 |
| -function logItem(item) { |
60 |
| - log('Clicked ' + item.title) |
61 |
| -} |
62 |
| - |
63 |
| -function log(text) { |
64 |
| - output.innerHTML += text + '<br/>'; |
65 |
| -} |
66 |
| - |
67 |
| -Menu.show([ |
68 |
| - {title: 'One'}, |
69 |
| - {title: 'Two'}, |
70 |
| - {title: 'Three', children: [ |
71 |
| - {title: 'Three One'}, |
72 |
| - {title: 'Three Two'}, |
73 |
| - ]}, |
74 |
| - {title: 'Four'}, |
75 |
| -], 300, 300, logItem) |
76 |
| - |
77 |
| - </script> |
| 25 | + <script src="build.js"> </script> |
78 | 26 | </body>
|
0 commit comments