portails/assets/js/app.js

32 lines
713 B
JavaScript
Raw Normal View History

2020-04-15 15:48:16 +02:00
document.getElementById('mode').addEventListener('click', () => {
2020-11-04 08:26:58 +01:00
2020-04-15 15:48:16 +02:00
document.body.classList.toggle('dark');
localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light');
2020-11-04 08:26:58 +01:00
2020-04-15 15:48:16 +02:00
});
if (localStorage.getItem('theme') === 'dark') {
2020-11-04 08:26:58 +01:00
2020-04-15 15:48:16 +02:00
document.body.classList.add('dark');
2020-11-04 08:26:58 +01:00
}
2020-12-03 16:07:04 +01:00
/* eslint-disable */
var clipboard = new ClipboardJS('.btn-clipboard');
clipboard.on('success', function(e) {
/*
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
*/
e.clearSelection();
});
clipboard.on('error', function(e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
/* eslint-enable */