1.1.10 • Published 1 year ago
bridgeline-kabinet v1.1.10
kabinet
App switcher for Bridgeline applications
Getting Started
- Run
npm install bridgeline-kabinet
- Modify your HTML by importing the Kabinet script file and adding the appropriate HTML elements.
<head>
<script src="node_modules/bridgeline-kabinet/dist/index.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
const kabinetComponent = document.querySelector('kabinet-drawer');
const trigger = document.querySelector('.kabinet-trigger');
trigger.addEventListener('click', function () {
kabinetComponent.openDrawer();
});
kabinetComponent.addEventListener('open-kabinet' ,() => {
console.log('open-drawer custom event');
});
kabinetComponent.addEventListener('close-kabinet' ,() => {
console.log('close-drawer custom event');
});
});
</script>
</head>
<body>
<button class="kabinet-trigger">Open Kabinet</button>
<kabinet-drawer></kabinet-drawer>
</body>