| <title>Panel and ButtonGroup demo</title> |
| <script src="../js/lib/require.js" async="async"></script> |
| <link type="text/css" rel="stylesheet" href="../css/kalamar.css" /> |
| <nav id="mainButton" style="position: absolute; width: 100%; top: 150px"></nav> |
| require(['buttongroup', 'panel', 'view/result/koralquery', 'state'], function (btnClass, panelClass, kqClass, stateClass) { |
| '@type' : "https://beispiel", |
| let panel = panelClass.create(); |
| let actions = panel.actions; |
| actions.add('Meta',{'cls':['meta']}, function () { |
| console.log(this.button.classList.contains('meta')); |
| var list = actions.addList('More', ['list']); |
| ['cool', 'cool', function (e, action) { console.log('really' + this.action()) }], |
| ['very cool', 'veryCool', function (e, action) { console.log('very cool') }] |
| let s = stateClass.create(true); |
| setState : function (val) { |
| document.body.style.backgroundColor = 'red'; |
| document.body.style.backgroundColor = 'transparent'; |
| actions.addToggle('Background',['bg'], s); |
| document.getElementById('mainButton').appendChild(panel.element()); |