blob: 73050b5bffc4b9dad02c0069be01c275fef9a20e [file] [log] [blame]
Akron52ed22d2018-07-11 17:05:19 +02001<!DOCTYPE html>
2<html>
3 <head>
Akron537bc522018-07-13 19:06:27 +02004 <title>Panel and ButtonGroup demo</title>
Akron52ed22d2018-07-11 17:05:19 +02005 <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>
Akron537bc522018-07-13 19:06:27 +020010 <nav id="mainButton" style="position: absolute; width: 100%; top: 150px"></nav>
Akron52ed22d2018-07-11 17:05:19 +020011 </body>
12 <script>
13requirejs.config({
14 baseUrl: '../js/src',
15 paths : {
16 'lib': '../lib'
17 }
18});
19
20
Akron537bc522018-07-13 19:06:27 +020021require(['buttongroup', 'panel','view'], function (btnClass, panelClass, viewClass) {
22 var panel = panelClass.create();
23 var actions = panel.actions;
24 actions.add('Meta',['meta'], function () {
Akron52ed22d2018-07-11 17:05:19 +020025 console.log(this.button.classList.contains('meta'));
Akron537bc522018-07-13 19:06:27 +020026 view = viewClass.create();
27 panel.add(view);
Akron52ed22d2018-07-11 17:05:19 +020028 });
Akron537bc522018-07-13 19:06:27 +020029 var list = actions.addList('More', ['list']);
Akron52ed22d2018-07-11 17:05:19 +020030 list.readItems([
31 ['cool', 'cool', function (e, action) { console.log('really' + this.action()) }],
32 ['very cool', 'veryCool', function (e, action) { console.log('very cool') }]
33 ]);
Akron537bc522018-07-13 19:06:27 +020034
35 document.getElementById('mainButton').appendChild(panel.element());
Akron52ed22d2018-07-11 17:05:19 +020036});
37
38
39 </script>
40</html>