Akron | 52ed22d | 2018-07-11 17:05:19 +0200 | [diff] [blame^] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Hint demo</title> |
| 5 | <meta charset="utf-8" /> |
| 6 | <script src="../js/lib/require.js" async="async"></script> |
| 7 | <link type="text/css" rel="stylesheet" href="../css/kalamar.css" /> |
| 8 | </head> |
| 9 | <body> |
| 10 | <nav id="mainButton" style="position: absolute; top: 300px"></nav> |
| 11 | </body> |
| 12 | <script> |
| 13 | requirejs.config({ |
| 14 | baseUrl: '../js/src', |
| 15 | paths : { |
| 16 | 'lib': '../lib' |
| 17 | } |
| 18 | }); |
| 19 | |
| 20 | |
| 21 | require(['buttongroup'], function (btnClass) { |
| 22 | btns = btnClass.create(); |
| 23 | btns.add('Meta',['meta'], function () { |
| 24 | console.log(this.button.classList.contains('meta')); |
| 25 | }); |
| 26 | var list = btns.addList('More', ['list']); |
| 27 | list.readItems([ |
| 28 | ['cool', 'cool', function (e, action) { console.log('really' + this.action()) }], |
| 29 | ['very cool', 'veryCool', function (e, action) { console.log('very cool') }] |
| 30 | ]); |
| 31 | document.getElementById('mainButton').appendChild(btns.element()); |
| 32 | }); |
| 33 | |
| 34 | |
| 35 | </script> |
| 36 | </html> |