Spaces:
Running
Running
File size: 1,176 Bytes
3060a8b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```javascript
document.addEventListener('DOMContentLoaded', function() {
// Handle tab switching
document.querySelectorAll('.nav-link').forEach(tab => {
tab.addEventListener('click', function(e) {
e.preventDefault();
document.querySelectorAll('.nav-link').forEach(t => t.classList.remove('active'));
this.classList.add('active');
// Here you would load the sections for the selected tab
});
});
// Handle section selection
document.querySelectorAll('.list-group-item').forEach(item => {
item.addEventListener('click', function() {
document.querySelectorAll('.list-group-item').forEach(i => i.classList.remove('active'));
this.classList.add('active');
// Here you would load the notes for the selected section
});
});
// Simulate loading notes when clicking sections
document.querySelectorAll('.list-group-item').forEach(section => {
section.addEventListener('click', function() {
const editorFrame = document.querySelector('iframe');
editorFrame.src = 'editor.html';
});
});
});
``` |